Make a sword do more damage after killing an entity

Started by dbm1234 on

Topic category: Help with Minecraft modding (Java Edition)

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?

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?

Joined May 2020
Points:

User statistics:

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

Permanently

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.

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

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

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!

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

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

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

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)

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

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???

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