If I detect a player having a nether star in his inventory, and it detected let's say "XPhotoCrafterX", how can I make it so it automatically effects him with strength 3?
I've tried to search on google but it didn't work.
minecraft-commandsminecraft-java-edition
If I detect a player having a nether star in his inventory, and it detected let's say "XPhotoCrafterX", how can I make it so it automatically effects him with strength 3?
I've tried to search on google but it didn't work.
Best Answer
You will need to assign a label to the player based on their NBT data first and then target based on their label.
/testfor
will not be useful as it does not label the players that were found.1.9
No objectives needed.
And then you'd target them with the
tag
parameter.1.8
Objective required.
Run on a clock in presented order.
Players will have their "HasItem" score set to 1 if they have a nether star in their inventory. You can then target them based on their score.