Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- One Time Run.
- /scoreboard players tag @e remove LowestX
- /execute @e[tag=LineDraw] ~ ~ ~ scoreboard players operation @e[c=1,tag=LineDraw] OrXL = @e[c=1,tag=LineDraw] OrX
- /scoreboard players set LOWEST OrX 2147483647
- /scoreboard players operation LOWEST OrX < @e[tag=LineDraw] OrX
- /scoreboard players operation @e[tag=LineDraw] OrXL -= LOWEST OrX
- /scoreboard players tag @e[score_OrXL=0,tag=LineDraw] add LowestX
- /execute @e[score_OrX=2147483647,tag=!LowestX] ~ ~ ~ summon armor_stand ~ ~1 ~ {Tags:["LinePart","LineCon"],NoGravity:1b}
- /scoreboard players set 1000 OrX 100000
- scoreboard players operation @e[c=1,tag=LineCon] ChangeX = @e[c=1,tag=LowestX] OrX
- scoreboard players operation @e[c=1,tag=LineCon] ChangeY = @e[c=1,tag=LowestX] OrY
- scoreboard players operation @e[c=1,tag=LineCon] ChangeX -= @e[score_OrX=2147483647,tag=!LowestX] OrX
- scoreboard players operation @e[c=1,tag=LineCon] ChangeY -= @e[score_OrX=2147483647,tag=!LowestX] OrY
- /scoreboard players set -1 OrX -1
- /scoreboard players tag @e[tag=LineCon] add DivideX
- /scoreboard players tag @e[tag=LineCon,score_ChangeX_min=0,score_ChangeX=0] remove DivideX
- /scoreboard players tag @e[tag=LineCon,score_ChangeX_min=0,score_ChangeX=0] add DivideY
- scoreboard players tag @e[tag=DivideY,score_ChangeY_min=0,score_ChangeY=0] add LineEr
- execute @e[tag=LineEr] ~ ~ ~ /tellraw @p ["",{"text":"Error ","color":"red","bold":true},{"text":"Line cannot be drawn!","color":"red","bold":false}]
- kill @e[tag=LineEr]
- execute @e[tag=DivideX] ~ ~ ~ scoreboard players operation @e[c=1,tag=LineCon] YMultSign = @e[c=1,tag=LineCon] ChangeY
- execute @e[tag=DivideY] ~ ~ ~ scoreboard players operation @e[c=1,tag=LineCon] XMultSign = @e[c=1,tag=LineCon] ChangeX
- /scoreboard players operation @e[tag=DivideX] ChangeY *= 1000 OrX
- /scoreboard players operation @e[tag=DivideY] ChangeX *= 1000 OrX
- execute @e[tag=DivideX] ~ ~ ~ /scoreboard players operation @e[tag=LineCon] ChangeY /= @e[c=1,tag=LineCon] ChangeX
- execute @e[tag=DivideY] ~ ~ ~ /scoreboard players operation @e[tag=LineCon] ChangeX /= @e[c=1,tag=LineCon] ChangeY
- /scoreboard players operation @e[tag=DivideX,score_YMultSign_min=1,score_ChangeY=-1] ChangeY *= -1 OrX
- /scoreboard players operation @e[tag=DivideX,score_YMultSign=-1,score_ChangeY_min=1] ChangeY *= -1 OrX
- /scoreboard players operation @e[tag=DivideY,score_XMultSign_min=1,score_ChangeX=-1] ChangeX *= -1 OrX
- /scoreboard players operation @e[tag=DivideY,score_XMultSign=-1,score_ChangeX_min=1] ChangeX *= -1 OrX
- /scoreboard players operation @e[tag=LineCon] YTravel = @e[tag=LineCon] ChangeY
- /scoreboard players operation @e[tag=LineCon] XTravel = @e[tag=LineCon,c=1] ChangeX
- /scoreboard players set @e[tag=LineCon] DrawState 0
- /execute @e[tag=LinePoint] ~ ~ ~ setblock ~ ~-1 ~ wool 15
- On a Clock (or you know, hit a button repetitively for a long time...)
- /execute @e[tag=LineCon] ~ ~ ~ setblock ~ ~-2 ~ wool 15
- /scoreboard players operation @e[score_DrawState_min=0,score_DrawState=0] YMove += @e[c=1,score_DrawState_min=0,score_DrawState=0] YTravel
- /scoreboard players set @e[score_YMove_min=100000] DrawState 1
- /scoreboard players set @e[score_YMove=-100000] DrawState 1
- tp @e[score_DrawState_min=1,score_DrawState=1,score_YTravel=-1] ~ ~ ~-1
- tp @e[score_DrawState_min=1,score_DrawState=1,score_YTravel_min=1] ~ ~ ~1
- scoreboard players remove @e[score_DrawState_min=1,score_DrawState=1] YMove 100000
- /scoreboard players set @e[score_YMove=99999] DrawState 0
- /tp @e[score_DrawState_min=0,score_DrawState=0,score_XTravel_min=1] ~1 ~ ~
- /tp @e[score_DrawState_min=0,score_DrawState=0,score_XTravel=-1] ~-1 ~ ~
- /scoreboard players remove @e[score_DrawState_min=0,score_DrawState=0,score_XTravel_min=1] XTravel 1
- /scoreboard players add @e[score_DrawState_min=0,score_DrawState=0,score_XTravel=-1] XTravel 1
- /execute @e[tag=LowestX] ~ ~1 ~ teleport @e[r=1,tag=LineCon] ~ ~ ~
- /execute @e[tag=LineCon] ~ ~ ~ setblock ~ ~-2 ~ wool 15
- kill @e[score_XTravel=0,score_XTravel_min=0]
- Scoreboards (need to be added in order for this to work)
- /scoreboard objectives add ChangeX dummy
- /scoreboard objectives add ChangeY dummy
- /scoreboard objectives add DrawState dummy
- /scoreboard objectives add OrX dummy
- /scoreboard objectives add OrXL dummy
- /scoreboard objectives add OrY dummy
- /scoreboard objectives add XMultSign dummy
- /scoreboard objectives add XTravel dummy
- /scoreboard objectives add YMove dummy
- /scoreboard objectives add YMultSign dummy
- /scoreboard objectives add YTravel dummy
- -_-Info-_-
- I am not responsible for any broken worlds, I just quickly threw this together
- I may have misspellde some Scoreboards, for my commands adding them were rudely destroyed
- If anything does not work I would be glad to take a look
- Coordinates of armor_stands must be kept in OrX and OrY, please no negatives
- Does not have to be Minecraft's coordinates
- armor_stand points must have Tags:["LinePoint","LineDraw","LinePart"]
- must be only 2 armor_stand points.
- I may have forgot to list something in this list, get over it.
- Chow!
Advertisement
Add Comment
Please, Sign In to add comment