Need help with shrinking projectile stacks + decreasing durability

Started by rasul on

Topic category: Help with modding (Java Edition)

Last seen on 01:20, 4. Mar 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Need help with shrinking projectile stacks + decreasing durability

Hey there, I'm currently creating a mod that adds a 'sling' weapon into the game (i.e. stone sling). The sling is used to shoot projectiles (pebbles). I have gotten everything working but 2 things:

  • The sling shoots only if there is a pebble in the player's inventory (same as a bow with arrows). However, I can't figure out how to make it "use" the pebble. Meaning, if you have 1 pebble in your inventory, the sling can shoot infinite (as the # of pebbles in your inventory are never decreased). Is there a procedure to do this?
  • I can't figure out how to make the durability lower every time you use the sling. Is there a procedure for this as well?

I can include some screenshots if needed.

 

Thank you!