In this video I will show you how to give yourself certain Minecraft item that you can make right clickable and have them do certain actions that you would want them to do.
Consumable Item Commands video: • Command Block Tutorial #268: Consumable It...
Item Cooldown Commands video: • Command Block Tutorial #272: Item Cooldown...
Commands (examples):
To get the right clickable items:
Example 1 (Emerald): /give @p emerald[consumable={consume_seconds:0,sound:"entity.experience_orb.pickup",has_consume_particles:false},custom_data={Emerald:1b}] 1
Example 2 (Glistering Melon Slice): /give @p glistering_melon_slice[consumable={has_consume_particles:false,on_consume_effects:[{type:"minecraft:apply_effects",effects:[{id:"minecraft:saturation",amplifier:0,duration:7,show_particles:0b}]}]},custom_data={Glistering_Melon_Slice:1b}] 1
Example 3 (Iron Ingot): /give @p minecraft:iron_ingot[consumable={consume_seconds:0,animation:"none",sound:"entity.iron_golem.repair",has_consume_particles:false},custom_data={Iron_ingot:1b},use_cooldown={seconds:3,cooldown_group:"iron_ingot:1b"}] 1
Scoreboard Commands (To add and remove):
Emerald:
/scoreboard objectives add Emerald minecraft.used:minecraft.emerald
/scoreboard objectives remove Emerald
Glistering_Melon_Slice:
/scoreboard objectives add Glistering_Melon_Slice minecraft.used:minecraft.glistering_melon_slice
/scoreboard objectives remove Glistering_Melon_Slice
Iron_Ingot:
/scoreboard objectives add Iron_Ingot minecraft.used:minecraft.iron_ingot
/scoreboard objectives remove Iron_Ingot
To activate the right clickable items:
Emerald:
1. Repeater Command Block: /execute at @p run execute as @r at @s if entity @s[scores={Emerald=1..}] run scoreboard players set @e[scores={Emerald=1..}] Emerald 0
2. Chain Command Block: /execute at @p run effect give @p minecraft:hero_of_the_village 30 1 true
3. Chain Command Block: /execute at @p run effect give @p minecraft:luck 30 1 true
4. Chain Command Block: /execute at @p run tellraw @p {"bold":true,"color":"green","italic":false,"text":"I'm feeling lucky!"}
Glistering Melon Slice:
1. Repeater Command Block: /execute at @p run execute as @r at @s if entity @s[scores={Glistering_Melon_Slice=1..}] run scoreboard players set @e[scores={Glistering_Melon_Slice=1..}] Glistering_Melon_Slice 0
2. Chain Command Block: /execute at @p run item replace entity @p weapon.mainhand with glistering_melon_slice[consumable={has_consume_particles:false,on_consume_effects:[{type:"minecraft:apply_effects",effects:[{id:"minecraft:saturation",amplifier:0,duration:7,show_particles:0b}]}]},custom_data={Glistering_Melon_Slice:1b}] 1
3. Chain Command Block: /execute at @p run give @p minecraft:gold_ingot
Iron Ingot:
1. Repeater Command Block: /execute at @p run execute as @r at @s if entity @s[scores={Iron_Ingot=1..}] run scoreboard players set @e[scores={Iron_Ingot=1..}] Iron_Ingot 0
2. Chain Command Block: /execute at @p run item replace entity @p weapon.mainhand with iron_ingot[consumable={consume_seconds:0,animation:"none",sound:"entity.iron_golem.repair",has_consume_particles:false},custom_data={Iron_ingot:1b},use_cooldown={seconds:3,cooldown_group:"iron_ingot:1b"}] 1
3. Chain Command Block: /execute at @p run summon minecraft:iron_golem ~ ~ ~
Music:
1. Monkeys Spinning Monkeys (Kevin MacLeod) - Gaming Background Music (HD):
https://www.youtube.com/watch?v=pr42a...