How do I make this command in Minecraft?
I've seen multiple creative servers that have items with added speed when held. Is there any way to get a command for it or is it just a cheap hack?
Best Answer
You can apply a generic.movementSpeed
attribute modifier to the item so that you don't need to include any external command mechanisms. For example, the following provides the player with stone that, when held, increases the player's movement speed by 30%:
/give @p minecraft:stone 1 0 {AttributeModifiers:[{AttributeName:"generic.movementSpeed",Name:"+30%",Amount:0.3,Operation:1,Slot:"mainhand",UUIDLeast:1l,UUIDMost:1l}]}
Pictures about "How do I make this command in Minecraft?"
How do you make your own command in Minecraft?
You will first want to head to the Game Panel. Once you are there, to the left of the panel click on Commands . This will open up a new page where you can view, modify, or create commands. To create a command, simply click Create Command to the top left of the page.How do you type commands in Minecraft?
To use a Minecraft command or cheat, all you need to do is hop into your Minecraft game and tap the "/" key to open up the console. Every command in Minecraft must start with a "/", but using this shortcut will automatically add the "/" prefix so you can just start typing the command you want to use.3 USEFUL COMMANDS TUTORIAL in Minecraft Bedrock (MCPE/Xbox/PS4/Nintendo Switch/Windows10)
More answers regarding how do I make this command in Minecraft?
Answer 2
Set up a scoreboard testing when a player hold the item, then execute that player accordingly.
You'll want to set up the scoreboard like this:
/scoreboard objectives add holdItemOne dummy
note that it's dummy
because we're adding a score when someone holds the item.
Make sure that these following commands are on a clock, but in this order:
- /scoreboard players set @a holdItemOne 0
- /scoreboard players set @a holdItemOne 1 {SelectedItem:{id:"minecraft:stick",tag:{display:{Name:"Speedy Stick"}}}}
- effect @a[score_holdItemOne_min=1] minecraft:speed 5 5
note that you can change the scoreboard objective name, what the player is holding, and the effect as you wish.
If you want to have it in one command, I would reccomend finding a one command block creator
, or something along the lines of that.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Yan Krukov, Anna Shvets, Ivan Babydov, Anete Lusina