#Chunk Outline v1.0 by RezzedUp #Requires SkQuery #--- #Tested and built with: #Skript version 2.1.2 #SkQuery version 3.21.4 #Configuration: options: DoCooldown: false #Set to true to have a cooldown for outlines that automatically disappear after a while CooldownTime: 1 minute #Cooldown duration TempOutlineDuration: 20 seconds #How long the temporary outlines will last before they automatically disappear OutlineBlock: glowstone #Block for the chunk outline #Outline command: command /outline [] []: permission: chunk.outline permission message: &cYou don't have permission for that! trigger: arg 1 is "help": send json of "&bChunk Outline:&f Help" tooltip "Script by &eRezzedUp" to player send json of "&b>&3 Hover over messages from this script for more info!" tooltip "Just like that!" to player send json of "&fCommands:" tooltip "How to outline your chunk." to player send json of "- &7/outline" tooltip "Create an outline that &oautomatically&r disappears &erelative to you." to player send json of "- &7/outline here" tooltip "Create an outline that &oautomatically&r disappears &eat your altitude." to player send json of "- &7/outline stay" tooltip "Create an outline that disappears &oafter relog &erelative to you." to player send json of "- &7/outline stay here&f or&7 /outline here stay" tooltip "Create an outline that disappears &oafter relog &eat your altitude" to player send json of "- &7/outline help" tooltip "You're already here!" to player stop {@DoCooldown} is true: {temp.chunk-outline.timestamp.%player%} is set: difference between {temp.chunk-outline.timestamp.%player%} and now is more than or equal to {@CooldownTime}: set {_CanUse} to true else: set {_CanUse} to false else: set {_CanUse} to true if {_CanUse} is true: arg 1 is set: if arg 1 is "here": set {_SkipTopPossible} to true arg 2 is "stay": set {_SkipDisappear} to true else if arg 1 is "stay": set {_SkipDisappear} to true arg 2 is "here": set {_SkipTopPossible} to true else: message "Unknown." stop {@DoCooldown} is true: {_SkipDisappear} is not set: set {temp.chunk-outline.timestamp.%player%} to now set {_xvar} to rounded down (1/16 * player's x coordinate) set {_xvar} to {_xvar} * 16 set {_yvar} to (player's y coordinate - 1) set {_zvar} to rounded down (1/16 * player's z coordinate) set {_zvar} to {_zvar} * 16 while {_endLoop} is not set: {_addTurns} is not set: set {_addTurns} to 0 {_TurnStage} is not set: set {_TurnStage} to 0 {_BlockConfirmed} is set: delete {_BlockConfirmed} if {_TurnStage} is 0: {_addTurns} is less than 16: set {_addX} to {_addTurns} {_addTurns} is 15: set {_addTurnsReset} to true add 1 to {_TurnStage} else if {_TurnStage} is 1: {_addTurns} is less than 16: set {_addZ} to {_addTurns} {_addTurns} is 15: set {_addTurnsReset} to true add 1 to {_TurnStage} else if {_TurnStage} is 2: {_ZChanged} is not set: add 16 to {_zvar} set {_ZChanged} to true {_addTurns} is less than 16: set {_addZ} to {_addTurns} {_addTurns} is 15: set {_addTurnsReset} to true add 1 to {_TurnStage} else if {_TurnStage} is 3: {_xChanged} is not set: add 16 to {_xvar} set {_XChanged} to true {_addTurns} is less than 16: set {_minusX} to {_addTurns} {_addTurns} is 15: set {_addTurnsReset} to true add 1 to {_TurnStage} {_TurnStage} is less than or equal to 1: {_SkipTopPossible} is not set: set {_tempY} to {_yvar} set {_BlockConfirmed} to false while {_BlockConfirmed} is false: block at ({_xvar} + {_addX}), {_tempY}, ({_zvar} + {_addZ}) in chunk of player is not air: block above block at ({_xvar} + {_addX}), {_tempY}, ({_zvar} + {_addZ}) in chunk of player is air: set {_BlockConfirmed} to true else: add 1 to {_tempY} else: subtract 1 from {_tempY} make player see block at ({_xvar} + {_addX}), {_tempY}, ({_zvar} + {_addZ}) in chunk of player as {@OutlineBlock} {_SkipDisappear} is not set: add location of block at ({_xvar} + {_addX}), {_tempY}, ({_zvar} + {_addZ}) in chunk of player to {_ChunkOutlines::*} else: make player see block at ({_xvar} + {_addX}), {_yvar}, ({_zvar} + {_addZ}) in chunk of player as {@OutlineBlock} {_SkipDisappear} is not set: add location of block at ({_xvar} + {_addX}), {_yvar}, ({_zvar} + {_addZ}) in chunk of player to {_ChunkOutlines::*} {_TurnStage} is more than or equal to 2: {_SkipTopPossible} is not set: set {_tempY} to {_yvar} set {_BlockConfirmed} to false while {_BlockConfirmed} is false: block at ({_xvar} - {_minusX}), {_tempY}, ({_zvar} + {_addZ}) in chunk of player is not air: block above block at ({_xvar} - {_minusX}), {_tempY}, ({_zvar} + {_addZ}) in chunk of player is air: set {_BlockConfirmed} to true else: add 1 to {_tempY} else: subtract 1 from {_tempY} make player see block at ({_xvar} - {_minusX}), {_tempY}, ({_zvar} + {_addZ}) in chunk of player as {@OutlineBlock} {_SkipDisappear} is not set: add location of block at ({_xvar} - {_minusX}), {_tempY}, ({_zvar} + {_addZ}) in chunk of player to {_ChunkOutlines::*} else: make player see block at ({_xvar} - {_minusX}), {_yvar}, ({_zvar} + {_addZ}) in chunk of player as {@OutlineBlock} {_SkipDisappear} is not set: add location of block at ({_xvar} - {_minusX}), {_yvar}, ({_zvar} + {_addZ}) in chunk of player to {_ChunkOutlines::*} add 1 to {_addTurns} {_addTurnsReset} is true: set {_addTurns} to 0 set {_addTurnsReset} to false {_TurnStage} is 4: set {_endLoop} to true {_SkipDisappear} is not set: {_SkipTopPossible} is not set: send json of "&bChunk Outline:&f Temporary outline created." tooltip "Outline will last {@TempOutlineDuration} or until you relog." to player else: send json of "&bChunk Outline:&f Temporary outline created at your altitude." tooltip "Outline will last {@TempOutlineDuration} or until you relog." to player wait {@TempOutlineDuration} loop {_ChunkOutlines::*}: make player see block at loop-value as block at loop-value else: {_SkipTopPossible} is not set: send json of "&bChunk Outline:&f Outline created." tooltip "Outline will last until you relog." to player else: send json of "&bChunk Outline:&f Outline created at your altitude." tooltip "Outline will last until you relog." to player else: message "&bChunk Outline:&f Please wait a moment to outline a chunk again."