Recipe Help

Started by Neutrino on

Topic category: Help with modding (Java Edition)

Last seen on 00:19, 21. Jan 2021
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Recipe Help

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.

Last seen on 11:41, 31. Mar 2024
Joined Aug 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Maybe a screenshot of what…
Sun, 01/17/2021 - 13:47

Maybe a screenshot of what you have would help.

Last seen on 19:10, 4. Aug 2023
Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I think that you can create…
Mon, 01/18/2021 - 07:25

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.