I'm trying to set up a series of working commands that test when the player breaks the wool block (i.e. the flag), they get tagged as the FlagCarrier
. They will also have other effects applied, specifically the glowing effect and a banner placed on their head. I know how to do the glowing and banner, but for some reason I can't seem to get the 'FlagCarrier' commands to work.
I was originally trying to testfor
when a player breaks a certain block (at exact coordinates) I tried testing for air (which worked) - but how does the command know who broke it? So now instead I'm trying to tag whoever picks it up and has the wool block in their inventory. But I can't seem to:
/execute @a {Inventory:[{id:"minecraft:wool",Damage:11s}]} /scoreboard players set @a FlagCarrier 1.
For some reason execute doesn't work with scoreboard?
My original set-up commands are:
/execute @a[r=100] ~ ~ ~ /scoreboard objectives add FlagCarrier dummy
This has a comparator leading into a block with a redstone torch, so it activates when the player is NOT within 100 blocks: /execute @a ~ ~ ~ /scoreboard objectives remove FlagCarrier
/execute @a[r=100] ~ ~ ~ /scoreboard objectives setdisplay sidebar FlagCarrier
(also, this isn't showing unless I manually set it to either 1 or 0)
Also, how can I replace the block if there is no player tagged FlagCarrier
, and no flag item on the ground? I would like to have it so a player on the blue team cannot pick up the blue flag, and it is instead returned to their base. whereas a red player could pick up the dropped flag and gain the tags.
I'm playing version 1.12, so any of the new or changed commands from 1.13+ won't help.
/execute @a {Inventory:[{id:"minecraft:wool",Damage:11s}]} /scoreboard players set @a FlagCarrier 1
doesn't have tildes? Shouldn't it be/execute @a {Inventory:[{id:"minecraft:wool",Damage:11s}]} ~ ~ ~ scoreboard players set @a FlagCarrier 1
?