Recipe Help

Started by Neutrino on Sun, 01/17/2021 - 07:40

Topic category: Help with modding (Java Edition)

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

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Recipe Help
Sun, 01/17/2021 - 07:40

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 19:01, 27. Feb 2021
Joined Aug 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 12:57, 27. Feb 2021
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.