Created
August 18, 2017 02:22
-
-
Save Arcensoth/4f3a4aee5d9a7fb6d5387fc942281d36 to your computer and use it in GitHub Desktop.
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
# (1) explicitly chained | |
commands.execute().chain( | |
commands.execute.at( | |
target=selectors.entities(type=entities.creeper)) | |
).chain( | |
commands.execute.unless_entity( | |
target=selectors.entities(type=entities.ocelot, r=3)) | |
).chain( | |
commands.execute.if_block( | |
position=(0, -1, 0), | |
block=blocks.grass) | |
).then( | |
commands.summon( | |
position=(0, 0, 0), | |
entity=entities.ocelot)) | |
# (2) up-front as a group | |
commands.execute( | |
modifiers=( | |
commands.execute.at( | |
target=selectors.entities(type=entities.creeper)), | |
commands.execute.unless_entity( | |
target=selectors.entities(type=entities.ocelot, r=3)), | |
commands.execute.if_block( | |
position=(0, -1, 0), | |
block=blocks.grass)), | |
command=commands.summon( | |
position=(0, 0, 0), | |
entity=entities.ocelot)) | |
# (3) recursively, as subcommands of one another | |
commands.execute.at( | |
target=selectors.entities(type=entities.creeper), | |
subcommand=commands.execute.unless_entity( | |
target=selectors.entities(type=entities.ocelot, r=3), | |
subcommand=commands.execute.if_block( | |
position=(0, -1, 0), | |
block=blocks.grass, | |
subcommand=commands.execute.then( | |
command=commands.summon( | |
position=(0, 0, 0), | |
entity=entities.ocelot))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment