Started by
Crimuretta
on
Topic category: Help with Minecraft modding (Java Edition)
Made a custom healing injector that supposed to have bow animation and lose durability each time it's used. (1.16.5)
When it's a no-food option, there's nothing happening when RMB is pressed at all — no animation, no effect and no consumption.
If it's food option turned on, it just get's consumed without taking durability and disappears like eh.
So how do i make it intended way if it's possible at all?
You're in luck because I've been trying to do the same thing and got it to work!
Step 1. Make sure your item has durability greater then 0 and set eating result to your item: https://imgur.com/a/nInxOxj
Step 2. After that make your first procedure. This procedure basically stores the item durability into a global var set as player lifetime: https://imgur.com/a/c9HEUVa
Step 3. Once that's done make your second procedure. The second one will cause the item to take damage whenever you finish using it: https://imgur.com/a/iqN7IUZ
!!! I missed up the links ignore the message above !!!
You're in luck because I've been trying to do the same thing and got it to work!
Step 1. Make sure your item has durability greater then 0 and set eating result to your item: step 1 - Imgur
Step 2. After that make your first procedure. This procedure basically stores the item durability into a global var set as player lifetime: step 2 - Imgur
Step 3. Once that's done make your second procedure. The second one will cause the item to take damage whenever you finish using it: step 3 - Imgur
You're kiiiinda late, this forum gives any answers so rarely i had to chat with GPT and make some custome code under it's redaction. And it worked nicely lol.
But still, thanks for your answer <3