Advertisement
Skylinerw

@Alphabot6 - Detecting Worldborder Size

Jul 20th, 2014
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Refer to: https://www.youtube.com/watch?v=sm0R4rUs5IY
  2.  
  3.  
  4. PREREQUISITES:
  5.  
  6. /scoreboard objectives add BORDER dummy
  7. /scoreboard players set #SIZE BORDER 0
  8.  
  9.  
  10. CLOCK COMMAND:
  11.  
  12. /worldborder get
  13.  
  14.  
  15. STAT SET:
  16.  
  17. /stats block ~ ~-1 ~ set QueryResult #SIZE BORDER
  18.  
  19. or
  20.  
  21. /setblock ~ ~ ~ minecraft:command_block 0 replace {Command:"worldborder get",CommandStats:{QueryResultName:"#SIZE",QueryResultObjective:"BORDER"}}
  22.  
  23. TESTING:
  24.  
  25. /scoreboard players test #SIZE BORDER 20 *
  26.  
  27. /tellraw @a "There border is at least 20 blocks in size."
  28. /tellraw @a ["(The actual border size is ",{score:{name:"#SIZE",objective:"BORDER"}},")"]
  29.  
  30. EXPLANATION:
  31.  
  32. The "/worldborder get" command will return the width of the border in blocks to the initiator. This doesn't do anything further without the aid of CommandStats. Setting the "QueryResult" stat will take that output and set a players' score. Using that, we can set the score of a fake player to the size of the worldborder, and then test for that size.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement