Skip to content

Instantly share code, notes, and snippets.

@intsuc
Last active September 23, 2019 22:26
Show Gist options
  • Save intsuc/b56fdfd06fdb21d1a86126d7ef0da4c4 to your computer and use it in GitHub Desktop.
Save intsuc/b56fdfd06fdb21d1a86126d7ef0da4c4 to your computer and use it in GitHub Desktop.
force remove

Usage

# Removes all entities.
tag @e add removed
function remove_entities

Known issue

The following warning is printed on each removal.

Keeping entity ... that already exists with UUID ...
kill @e[tag=removed, predicate=removable]
# the_nether
execute in minecraft:the_nether as @e[distance=0.0.., tag=removed] in minecraft:overworld run teleport @s 8.0 0.0 8.0
execute in minecraft:overworld as @e[x=7.5, y=-0.5, z=7.5, dx=0, tag=removed] in minecraft:the_nether run teleport @s 34359738360.0 0.0 34359738360.0
# overworld
execute in minecraft:overworld as @e[distance=0.0.., tag=removed] in minecraft:the_end run teleport @s 8.0 0.0 8.0
execute in minecraft:the_end as @e[x=7.5, y=-0.5, z=7.5, dx=0, tag=removed] in minecraft:overworld run teleport @s 34359738360.0 0.0 34359738360.0
# the_end
execute in minecraft:the_end as @e[distance=0.0.., tag=removed] in minecraft:the_nether run teleport @s 8.0 0.0 8.0
execute in minecraft:the_nether as @e[x=7.5, y=-0.5, z=7.5, dx=0, tag=removed] in minecraft:the_end run teleport @s 34359738360.0 0.0 34359738360.0
{
"condition": "minecraft:alternative",
"terms": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"type": "minecraft:armor_stand"
}
},
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"equipment": {}
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment