A sword that charges with 3 attacks and deals 4 attacks for 5 more.

Started by thestranniknumberone on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
A sword that charges with 3 attacks and deals 4 attacks for 5 more.

I want to make a sword that will charge from attacks. That is, after 3 attacks it will charge and 4 attacks will be strengthened. Then again 3 attacks and all over again. Is it possible to do this? If so, how?

Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If the sword will have the…
Mon, 11/14/2022 - 08:26

If the sword will have the charged status after drop aswell then so i think; when player swings item this is in the item by triggers, then set nbt data of the sword (call it like charged_status, the nbt) to the number plus on so add 1 (you also have to check if the nbt value exist if not then create by 0 then add 1) and if the value is 3 or higher then call a separat procedure the give the player strengh when hold the item and check after that is the nbt of the sword is higher or equal to 7 if that is the case set the value to 0

Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could create a procedure…
Sat, 11/26/2022 - 20:21

You could create a procedure that triggers whenever an entity is hurt. Check if the source entity is using your sword and if they are add 1 to a variable attached to that entity. Then check if your variable is at 3 or higher (hence meaning 3 hits have been made) and if it is apply extra damage to the entity. Then finally if the variable is at 7 or higher reset it to 0. I can make an image mockup if it would help.