how do I give an Item a random Enchantment when crafted

Started by FazeThree on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do I give an Item a random Enchantment when crafted
Mon, 03/13/2023 - 16:12 (edited)

I have made a crafting recipe for Enchanted Books, but  when crafted they don't come with an enchantment on them. I'm trying to get it to be a random enchantment but I am unable to figure it out.

Any help would be greatly appreciated, Thanks! 

Edited by FazeThree on Mon, 03/13/2023 - 16:12
Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I Figured It Out! This is…
Mon, 03/13/2023 - 16:31

I Figured It Out!

This is how it is constructed:

Global Trigger is set to Item is crafted, next an if statement, (If Provided Itemstack = "chosen item" ), If yes, then do: (Set 1 "wanted item" in slot 9 of block at x: x, y, z, if it has inventory) under that: (Add enchantment "wanted enchantment" with level "wanted level" to Provided Itemstack).

Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
now to make it random....
Mon, 03/13/2023 - 16:32

now to make it random....

Joined Mar 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Figured it out. Forum Closed.
Mon, 03/13/2023 - 16:56

Figured it out.

Forum Closed.

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can you give an example of…
Mon, 11/27/2023 - 01:25

Can you give an example of how you figured it out?