Make a sword do more damage after killing an entity

Started by dbm1234 on

Topic category: Help with modding (Java Edition)

Last seen on 22:56, 13. Aug 2023
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Make a sword do more damage after killing an entity

How make a sword do more damage after killing an entity? I intended to make the sword I made increase its damage by 5 when killing a villager with it. Can someone help me?

Last seen on 07:34, 25. Oct 2023
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry but could I ask your…
Fri, 06/24/2022 - 07:31

Sorry but could I ask your some more questions about your question? When you said you want it to increase damage after killing a villager, you want it to increase permanently or just for an amount of time or maybe increase the damage of the next attack?

Last seen on 22:56, 13. Aug 2023
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Permanently
Sat, 06/25/2022 - 02:24

Permanently

Last seen on 07:34, 25. Oct 2023
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry for not finding the…
Mon, 06/27/2022 - 06:14

Sorry for not finding the best solution for your problem, but I think you could try this for the mean time:

First you should create a global variable like this:

https://ibb.co/Wy41rWG

Then create a procedure like this one:

https://ibb.co/PgLf1xP

Anyway, hope this helps.

Last seen on 14:46, 25. May 2023
Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hi there, i cant find the…
Wed, 05/03/2023 - 20:54

hi there, i cant find the Get Global and Set Global for the procedure tuonkhung made. idk if its bc of an update but can you tell me where to find? also if you found a new way of doing the procedure i would like to ear it too

Last seen on 00:03, 16. May 2023
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
im having the same problem…
Sat, 05/06/2023 - 14:58

im having the same problem could someone post a pic on how to do it

Last seen on 19:20, 25. Jun 2023
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Something you could try is…
Sat, 05/06/2023 - 16:32

Something you could try is setting an NBT tag on the item (let's call it "strength") and when an entity is killed, increase the NBT tag.

Then, in the "before entity is hurt" global trigger, check if the source entity has the correct item in their main or offhand, then deal additional damage based on the strength NBT tag on the item.

Let me know if you need any more information!

Last seen on 00:03, 16. May 2023
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thank you for the help, but…
Sat, 05/06/2023 - 18:06

thank you for the help, but i dont know the name of all the tags

Last seen on 00:03, 16. May 2023
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
could you lease post a pic
Sat, 05/06/2023 - 18:07

could you lease post a pic

Last seen on 00:03, 16. May 2023
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
that would help a lot
Sat, 05/06/2023 - 18:07

that would help a lot

Last seen on 19:20, 25. Jun 2023
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm not entirely sure how to…
Fri, 05/12/2023 - 21:39

I'm not entirely sure how to put an image (because it uses urls instead of uploaded files)

The name of the nbt tags should all be a number tag named "strength" (although you can change the name of the tag, just make sure all the names of the tags are the same)

To check items in a players hand, use item in mainhand/offhand of source entity in the before entity is hurt global trigger (set it in the green block that appears in the procedure by default)

Last seen on 00:03, 16. May 2023
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
o, ok i just would really…
Sat, 05/13/2023 - 13:39

o, ok i just would really benafit from a pic

Last seen on 00:03, 16. May 2023
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
could u please take a…
Sat, 05/13/2023 - 16:00

could u please take a screenshot and make it a url then post it here???

Last seen on 00:03, 16. May 2023
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank u so much
Sun, 05/14/2023 - 00:26

Thank u so much