2

How to testfor held item?

ImNotToasted's Avatar ImNotToasted3/2/18 6:10 pm
2 emeralds 213 1
3/2/2018 6:58 pm
Isz's Avatar Isz
how do i testfor/execute a command when a player is holding a certain item for example giving speed 1 when you're holding a stone block?
Posted by ImNotToasted's Avatar
ImNotToasted
Level 20 : Expert Warrior
104

Create an account or sign in to comment.

1

2
03/02/2018 6:58 pm
Level 46 : Master Architect
Isz
Isz's Avatar
Not sure if it can be done via one execute command but it can be done with two command blocks in a chain

First command block
always active, repeating
/testfor @a {SelectedItem:{id:"minecraft:stone"}}

Second command block
always active, conditional, chain
/effect @a 1 1 1

you can change the block and effects etc.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome