Forumskeyboard_arrow_right Help keyboard_arrow_right Java Edition

Create Forum Thread
1

command block help

1 emeralds5 replies91 views
created 07/19/2019 2:27 am by Brainfreeze_
last reply 07/20/2019 5:30 am
i was just wondering what command would you use if you wanted to give status effects to someone if they're holding a certain item. for example, if you hold a rabbits foot in your hand, you'll gain jump boost.
Posted by avatar
Brainfreeze_
Level 14 : Journeyman Goblin
19

comment Login or register to post a reply.

5 replies

2
07/19/2019 3:32 am
Level 8 : Apprentice Modder
HoboMaggot
/execute if entity @a[nbt={SelectedItem:{id:"minecraft:rabbit_foot",Count:1b}}] run command
or
/execute as @a[nbt={SelectedItem:{id:"minecraft:rabbit_foot",Count:1b}}] at @s run
1
07/19/2019 11:33 am
Level 42 : Master Cowboy
CrazyCowMM
I would recommend the second one, because in your effect commands(I'll be using your example) you can do effect give @s jump_boost 1 2 and it will only effect the player who is holding the rabbits foot, making the command multiplayer friendly. The first command works fine, but even if you don't play on making your map multiplayer compatible, someone will player it with two players and it's always best to offer the most support possible for that.

(full command would be /execute as @a[nbt={SelectedItem:{id:"minecraft:rabbit_foot",Count:1b}}] at @s run effect give @s jump_boost 1 2
1
07/20/2019 12:41 am
Level 14 : Journeyman Goblin
Brainfreeze_
you think this command will work on console?
1
07/20/2019 5:30 am
Level 8 : Apprentice Modder
HoboMaggot
Basically what CrazyCow means is that it doesnt work on console, only on Java.
This is due to no nbt support for console/bedrock edition
1
07/20/2019 1:36 am
Level 42 : Master Cowboy
CrazyCowMM
It should work in functions, command blocks and anywhere else as long as you're 1.13+

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome