Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1.8:
- PREREQUISITES:
- Objective to track opening trapped chests:
- /scoreboard objectives add OpenTrapped stat.trappedChestTriggered
- Objective to state the player has stone:
- /scoreboard objectives add HasStone dummy
- CLOCK COMMANDS:
- Run the following in numerical order on a clock.
- 1. If the player has an OpenTrapped score of 1, as well as stone in their inventory, give them a "HasStone" score of 1.
- /scoreboard players set @a[score_OpenTrapped_min=1] HasStone 1 {Inventory:[{id:"minecraft:stone"}]}
- 2. You can then target players that have the "HasStone" tag, which would only be those players that have opened a trapped chest while they have stone in their inventory.
- /say @a[score_HasStone_min=1] opened a trapped chest while having stone in their inventory.
- 3. Reset "HasStone" on players.
- /scoreboard players set @a[score_HasStone_min=1] HasStone 0
- 4. Reset "OpenTrapped" on players.
- /scoreboard players set @a[score_OpenTrapped_min=1] OpenTrapped 0
- -----------------
- 1.9:
- PREREQUISITES:
- Objective to track opening trapped chests:
- /scoreboard objectives add OpenTrapped stat.trappedChestTriggered
- CLOCK COMMANDS:
- Run the following in numerical order on a clock.
- 1. If the player has an OpenTrapped score of 1, as well as stone in their inventory, give them the "HasStone" tag.
- /scoreboard players tag @a[tag=!HasStone,score_OpenTrapped_min=1] add HasStone {Inventory:[{id:"minecraft:stone"}]}
- 2. You can then target players that have the "HasStone" tag, which would only be those players that have opened a trapped chest while they have stone in their inventory.
- /say @a[tag=HasStone] opened a trapped chest while having stone in their inventory.
- 3. Reset tag on players.
- /scoreboard players tag @a[tag=HasStone] remove HasStone
- 4. Reset score on players.
- /scoreboard players set @a[score_OpenTrapped_min=1] OpenTrapped 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement