Started by
thestranniknumberone
on
Topic category: Help with Minecraft modding (Java Edition)
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?
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
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.