Advertisement
Skylinerw

@SkydiverTyler

Nov 5th, 2015
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. 1.8:
  2.  
  3. PREREQUISITES:
  4.  
  5. Objective to track opening trapped chests:
  6.  
  7. /scoreboard objectives add OpenTrapped stat.trappedChestTriggered
  8.  
  9. Objective to state the player has stone:
  10.  
  11. /scoreboard objectives add HasStone dummy
  12.  
  13. CLOCK COMMANDS:
  14.  
  15. Run the following in numerical order on a clock.
  16.  
  17. 1. If the player has an OpenTrapped score of 1, as well as stone in their inventory, give them a "HasStone" score of 1.
  18.  
  19. /scoreboard players set @a[score_OpenTrapped_min=1] HasStone 1 {Inventory:[{id:"minecraft:stone"}]}
  20.  
  21. 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.
  22.  
  23. /say @a[score_HasStone_min=1] opened a trapped chest while having stone in their inventory.
  24.  
  25. 3. Reset "HasStone" on players.
  26.  
  27. /scoreboard players set @a[score_HasStone_min=1] HasStone 0
  28.  
  29. 4. Reset "OpenTrapped" on players.
  30.  
  31. /scoreboard players set @a[score_OpenTrapped_min=1] OpenTrapped 0
  32.  
  33.  
  34. -----------------
  35.  
  36.  
  37. 1.9:
  38.  
  39. PREREQUISITES:
  40.  
  41. Objective to track opening trapped chests:
  42.  
  43. /scoreboard objectives add OpenTrapped stat.trappedChestTriggered
  44.  
  45. CLOCK COMMANDS:
  46.  
  47. Run the following in numerical order on a clock.
  48.  
  49. 1. If the player has an OpenTrapped score of 1, as well as stone in their inventory, give them the "HasStone" tag.
  50.  
  51. /scoreboard players tag @a[tag=!HasStone,score_OpenTrapped_min=1] add HasStone {Inventory:[{id:"minecraft:stone"}]}
  52.  
  53. 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.
  54.  
  55. /say @a[tag=HasStone] opened a trapped chest while having stone in their inventory.
  56.  
  57. 3. Reset tag on players.
  58.  
  59. /scoreboard players tag @a[tag=HasStone] remove HasStone
  60.  
  61. 4. Reset score on players.
  62.  
  63. /scoreboard players set @a[score_OpenTrapped_min=1] OpenTrapped 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement