Started by
Neutrino
on
Topic category: Help with Minecraft modding (Java Edition)
Is there a way to make a recipe that has a 50% chance of not working and deleting the items used? I tried using procedures to do this but it didn’t work.
Topic category: Help with Minecraft modding (Java Edition)
Is there a way to make a recipe that has a 50% chance of not working and deleting the items used? I tried using procedures to do this but it didn’t work.
Maybe a screenshot of what you have would help.
https://imgur.com/a/JGE5n03
I think that you can create an item that looks and is called the same, but it does nothing. Then you do:
item is crafted
if has event/target entity in inventory (that item)
do if Random [0,1) ≤ 0.5
do remove 1 (that item) from event/target entity main inventory
play at x: x y: y z: z level: 1 pitch: 1 sound: block.anvil.place
Add 1 (your other item) to event/target entity inventory.
if Random [0,1) ≤ 1
do remove 1 (that item) from event/target entity main inventory
play at x: x y: y z: z level: 1 pitch: 1 sound: block.anvil.place
Add 1 (another item for when recipe fails) to event/target entity inventory.
I'm not sure but i think that this should work.