1
Need help with 1.9 command
Hey guys, MrCatSquid here. I've been playing some 1.9 recently, and I need a command that I just can't figure out. I guess I could if I tried, because I've done it before, but I'm way too tired right now. Basically, I need to give a player levetation 1 whenever they hold a feather. That's all I need figured out. It doesn't need to detect nams or slot, just the item in hand. If someone could figure this out for me, that'd help alot!
2
Skitto493You would need to make 9 commands, 1 for each of the hotbar slots. Each of these commands would look like this:/scoreboard players tag @a add YourTag {SelectedItemSlot:0,Inventory:[{Slot:0b,id:"minecraft:feather"}]}
-snip-
Actually, there's a SelectedItem tag. It makes things like this much easier:
scoreboard players tag @a add YourTag {SelectedItem:{id:"minecraft:feather"}}Everything was good. I just thought this was worth pointing out.
You would need to make 9 commands, 1 for each of the hotbar slots. Each of these commands would look like this:
Then you would need this command:
Then, you would need this command:
You will need to hook these up in a sequence.
# = repeating command block
@ = chain command block
> = Direction command block is facing
#>@>@>
#
#
#
#
#
#
#
#
Each # has one of the tagging commands, the first @ has the second command, and the last symbol has the last command.
/scoreboard players tag @a add YourTag {SelectedItemSlot:0,Inventory:[{Slot:0b,id:"minecraft:feather"}]}Then you would need this command:
/effect @a[tag=YourTag] levitation 1 1 trueThen, you would need this command:
/scoreboard players tag @a remove YourTagYou will need to hook these up in a sequence.
# = repeating command block
@ = chain command block
> = Direction command block is facing
#>@>@>
#
#
#
#
#
#
#
#
Each # has one of the tagging commands, the first @ has the second command, and the last symbol has the last command.
