Started by
DeRokerij
on
Topic category: Help with Minecraft modding (Java Edition)
i cant quite seem to find out how i can get an item to change into a different time on a right click basically, if anyone has any ideas on this it would be most helpfull
Edited by DeRokerij on Wed, 01/11/2023 - 17:34
I have a mod with a lot of weapons that have abilities, and I found that the on right click procedure trigger for regular tools doesn't really work. So here's what I would recommend:
Make a ranged item for the inactive sword. Make it have no ammunition and have the swapping procedure on the "When item used" prompt. Set the projectile texture to air and have it deal no damage and knockback. You can set melee damage if you want, but this is a surefire way to make right click events work.
For the active one, you can do the same thing and set more melee damage, or you can make a tool. If you want to be able to deactivate it again, make it a ranged item as well and set damage.
If you want either of these to do something when you hit enemies (which ranged items do not have a procedure trigger for), create a procedure with the global trigger "entity attacked" and then have it check if the source entity is holding the item. Then do whatever effects you want on the event target entity.
Let me know if any of this doesn't work.
thank you ill try that
it did thank you, got it to work with that