Last active
August 22, 2019 15:07
-
-
Save intsuc/9746a82b2a39149ab8bf2fc12b5afe9b to your computer and use it in GitHub Desktop.
if statement with an implicit/explicit stack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute if score #condition boolean matches 1 run function explicit-1-then | |
# peek | |
execute store result score #condition boolean run data get entity @s HandItems[0].tag.boolean_stack[-1] | |
execute if score #condition boolean matches 0 run function explicit-1-else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# push | |
data modify entity @s HandItems[0].tag.boolean_stack append value 0b | |
execute store success entity @s HandItems[0].tag.boolean_stack[-1] byte 1 store success score #condition boolean if block 0 0 0 minecraft:air | |
function explicit-1-if | |
# pop | |
data remove entity @s HandItems[0].tag.boolean_stack[-1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute as 0-0-0-0-0 run function explicit-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute if entity @s[y_rotation=1] run function implicit-1-then | |
# peek | |
teleport @s ~ ~ ~ ~ ~ | |
execute if entity @s[y_rotation=0] run function implicit-1-else | |
# pop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute store success entity @s Rotation[0] float 1 if block 0 0 0 minecraft:air | |
# push | |
execute rotated as @s run function implicit-1-if |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
execute as 0-0-0-0-0 run function implicit-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scoreboard objectives add boolean dummy | |
summon minecraft:armor_stand ~ ~ ~ {UUIDMost: 0L, UUIDLeast: 0L, Marker: true, HandItems: [{id: "minecraft:tnt", Count: 1b, tag: {boolean_stack: []}}]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment