Skip to content

Commit b701226

Browse files
committed
✨ Add remove/entities function
`remove/entities` kills all entities related to a specific rig, whether they're attacked to a root entity or not.
1 parent 4e76edf commit b701226

File tree

8 files changed

+64
-16
lines changed

8 files changed

+64
-16
lines changed

src/systems/datapackCompiler/1.20.4/animation.mcb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,18 @@ dir <%export_namespace%> {
582582
}
583583

584584
dir remove {
585-
# Removes all instances of this rig from the world.
586585
function all {
586+
# Removes all instances of this rig from the world.
587587
execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this
588588
}
589-
# Removes the rig this function is executed as.
589+
590+
function entities {
591+
# Removes all entities related to this rig from the world.
592+
kill @e[tag=<%TAGS.PROJECT_ENTITY(export_namespace)%>]
593+
}
594+
590595
function this {
596+
# Removes the rig this function is executed as.
591597
IF (show_function_errors) {
592598
execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \
593599
function *global/errors/function_not_executed_as_root_entity \

src/systems/datapackCompiler/1.20.4/static.mcb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,18 @@ dir <%export_namespace%> {
237237
}
238238

239239
dir remove {
240-
# Removes all instances of this rig from the world.
241240
function all {
241+
# Removes all instances of this rig from the world.
242242
execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this
243243
}
244-
# Removes the rig this function is executed as.
244+
245+
function entities {
246+
# Removes all entities related to this rig from the world.
247+
kill @e[tag=<%TAGS.PROJECT_ENTITY(export_namespace)%>]
248+
}
249+
245250
function this {
251+
# Removes the rig this function is executed as.
246252
IF (show_function_errors) {
247253
execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \
248254
function *global/errors/function_not_executed_as_root_entity \

src/systems/datapackCompiler/1.20.5/animation.mcb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,18 @@ dir <%export_namespace%> {
582582
}
583583

584584
dir remove {
585-
# Removes all instances of this rig from the world.
586585
function all {
586+
# Removes all instances of this rig from the world.
587587
execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this
588588
}
589-
# Removes the rig this function is executed as.
589+
590+
function entities {
591+
# Removes all entities related to this rig from the world.
592+
kill @e[tag=<%TAGS.PROJECT_ENTITY(export_namespace)%>]
593+
}
594+
590595
function this {
596+
# Removes the rig this function is executed as.
591597
IF (show_function_errors) {
592598
execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \
593599
function *global/errors/function_not_executed_as_root_entity \

src/systems/datapackCompiler/1.20.5/static.mcb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,18 @@ dir <%export_namespace%> {
237237
}
238238

239239
dir remove {
240-
# Removes all instances of this rig from the world.
241240
function all {
241+
# Removes all instances of this rig from the world.
242242
execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this
243243
}
244-
# Removes the rig this function is executed as.
244+
245+
function entities {
246+
# Removes all entities related to this rig from the world.
247+
kill @e[tag=<%TAGS.PROJECT_ENTITY(export_namespace)%>]
248+
}
249+
245250
function this {
251+
# Removes the rig this function is executed as.
246252
IF (show_function_errors) {
247253
execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \
248254
function *global/errors/function_not_executed_as_root_entity \

src/systems/datapackCompiler/1.21.2/animation.mcb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,18 @@ dir <%export_namespace%> {
582582
}
583583

584584
dir remove {
585-
# Removes all instances of this rig from the world.
586585
function all {
586+
# Removes all instances of this rig from the world.
587587
execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this
588588
}
589-
# Removes the rig this function is executed as.
589+
590+
function entities {
591+
# Removes all entities related to this rig from the world.
592+
kill @e[tag=<%TAGS.PROJECT_ENTITY(export_namespace)%>]
593+
}
594+
590595
function this {
596+
# Removes the rig this function is executed as.
591597
IF (show_function_errors) {
592598
execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \
593599
function *global/errors/function_not_executed_as_root_entity \

src/systems/datapackCompiler/1.21.2/static.mcb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,18 @@ dir <%export_namespace%> {
237237
}
238238

239239
dir remove {
240-
# Removes all instances of this rig from the world.
241240
function all {
241+
# Removes all instances of this rig from the world.
242242
execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this
243243
}
244-
# Removes the rig this function is executed as.
244+
245+
function entities {
246+
# Removes all entities related to this rig from the world.
247+
kill @e[tag=<%TAGS.PROJECT_ENTITY(export_namespace)%>]
248+
}
249+
245250
function this {
251+
# Removes the rig this function is executed as.
246252
IF (show_function_errors) {
247253
execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \
248254
function *global/errors/function_not_executed_as_root_entity \

src/systems/datapackCompiler/1.21.4/animation.mcb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,18 @@ dir <%export_namespace%> {
582582
}
583583

584584
dir remove {
585-
# Removes all instances of this rig from the world.
586585
function all {
586+
# Removes all instances of this rig from the world.
587587
execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this
588588
}
589-
# Removes the rig this function is executed as.
589+
590+
function entities {
591+
# Removes all entities related to this rig from the world.
592+
kill @e[tag=<%TAGS.PROJECT_ENTITY(export_namespace)%>]
593+
}
594+
590595
function this {
596+
# Removes the rig this function is executed as.
591597
IF (show_function_errors) {
592598
execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \
593599
function *global/errors/function_not_executed_as_root_entity \

src/systems/datapackCompiler/1.21.4/static.mcb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,18 @@ dir <%export_namespace%> {
237237
}
238238

239239
dir remove {
240-
# Removes all instances of this rig from the world.
241240
function all {
241+
# Removes all instances of this rig from the world.
242242
execute as @e[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run function *<%export_namespace%>/remove/this
243243
}
244-
# Removes the rig this function is executed as.
244+
245+
function entities {
246+
# Removes all entities related to this rig from the world.
247+
kill @e[tag=<%TAGS.PROJECT_ENTITY(export_namespace)%>]
248+
}
249+
245250
function this {
251+
# Removes the rig this function is executed as.
246252
IF (show_function_errors) {
247253
execute unless entity @s[type=item_display,tag=<%TAGS.PROJECT_ROOT(export_namespace)%>] run return run \
248254
function *global/errors/function_not_executed_as_root_entity \

0 commit comments

Comments
 (0)