1

Need help with 1.9 command

MrCatSquid 2/17/16 5:07 pm
388
2/17/2016 10:36 pm
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!
Posted by
MrCatSquid
Level 21 : Expert Fish
12

  Have something to say?

JoinSign in

2

Jmal116
02/17/2016 10:36 pm
Level 34 : Artisan System
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.
1
Skitto493
02/17/2016 7:14 pm
Level 55 : Grandmaster Dragon
You 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"}]}

Then you would need this command:

/effect @a[tag=YourTag] levitation 1 1 true

Then, you would need this command:

/scoreboard players tag @a remove YourTag

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.
1

Welcome