right clicking the air with the lucky diamond gives you a random lucky item. is there easier ways to write this code? did i overcomplicate anything?
luckdiamondore:
type: world
events:
on player breaks diamond_ore chance:50:
- determine luckydiamonditem
on player right clicks air with:luckydiamonditem:
- take iteminhand quantity:1
- define lucky_item <list[lucky_helmet|lucky_chestplate|lucky_leggings|lucky_boots|lucky_sword|lucky_pickaxe|lucky_axe|lucky_shovel|lucky_hoe].random[1]>
- give <[lucky_item]>
- adjust <[lucky_item]> enchantments:mending
- adjust <[lucky_item]> hides:ENCHANTS
- narrate "<&a>You received a lucky item!"
lucky_helmet:
type: item
material: diamond_helmet
display name: <&e>Lucky Helmet
enchantments:
- mending:1
mechanisms:
hides: ENCHANTS
lucky_chestplate:
type: item
material: diamond_chestplate
display name: <&e>Lucky Chestplate
enchantments:
- mending:1
mechanisms:
hides: ENCHANTS
lucky_leggings:
type: item
material: diamond_leggings
display name: <&e>Lucky Leggings
enchantments:
- mending:1
mechanisms:
hides: ENCHANTS
lucky_boots:
type: item
material: diamond_boots
display name: <&e>Lucky Boots
enchantments:
- mending:1
mechanisms:
hides: ENCHANTS
lucky_sword:
type: item
material: diamond_sword
display name: <&e>Lucky Sword
enchantments:
- mending:1
mechanisms:
hides: ENCHANTS
lucky_pickaxe:
type: item
material: diamond_pickaxe
display name: <&e>Lucky Pickaxe
enchantments:
- mending:1
mechanisms:
hides: ENCHANTS
lucky_axe:
type: item
material: diamond_axe
display name: <&e>Lucky Axe
enchantments:
- mending:1
mechanisms:
hides: ENCHANTS
lucky_shovel:
type: item
material: diamond_shovel
display name: <&e>Lucky Shovel
enchantments:
- mending:1
mechanisms:
hides: ENCHANTS
lucky_hoe:
type: item
material: diamond_hoe
display name: <&e>Lucky Hoe
enchantments:
- mending:1
mechanisms:
hides: ENCHANTS
LuckyDiamondItem:
type: item
material: diamond
display name: <&e>Lucky Diamond