184: Item with On/Off attributes. [Minecraft Map Making]
Ep184: Making an item that toggles between an On and Off state. When On it gives the player a speed boost.
Java Version: 1.19
Commands, builds and ideas for people making their own Minecraft maps.
Check out my collabs on Coppit's channel: https://www.youtube.com/c/CoppitJ
Join the CoppitCraft server that I play on and the Discord where I hang out.
Server IP: 51.81.246.145:25588
Discord: https://discord.gg/amU84KykEu
The following commands are prefixed with three letters which represent the settings of the command block. E.g IUN: = Impulse Unconditional Needs_Redstone. These prefixes need to be removed if copying the commands.
Commands used:
Setup:
IUN: scoreboard objectives add usedStick used:carrot_on_a_stick
CUA: scoreboard objectives add switch dummy
Give item:
IUN: give @p carrot_on_a_stick{switch_to:2,display:{Name:'{"text":"Speed: Off"}'}}
Controller:
RUA: execute as @a[scores={usedStick=1..}] store result score @s switch run data get entity @s SelectedItem.tag.switch_to
CUA: item replace entity @a[scores={switch=1}] weapon with carrot_on_a_stick{switch_to:2,display:{Name:'{"text":"Speed: Off"}'}}
CUA: item replace entity @a[scores={switch=2}] weapon with carrot_on_a_stick{switch_to:1,display:{Name:'{"text":"Speed: On"}'},AttributeModifiers:[{Slot:"mainhand",AttributeName:"generic.movement_speed",Name:"generic.movement_speed",Amount:0.5,Operation:0, UUID:[I; 10, 10, 10, 10]}]}
CUA: scoreboard players reset @a usedStick
CUA: scoreboard players reset @a switch
Other Videos By Infernal Device
Other Statistics
Minecraft Statistics For Infernal Device
At present, Infernal Device has 182,428 views spread across 865 videos for Minecraft, accounting for over 10 days of watchable video on his channel. This is 94.82% of the total watchable video for Minecraft on Infernal Device's YouTube channel.