Skip to content

Commit

Permalink
make entity.is_living work for Type objects
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Dec 26, 2019
1 parent 78f8d78 commit 6213ba0
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -2455,8 +2455,12 @@ else if (object.getBukkitEntity() instanceof Hanging) {
// @description
// Returns whether the entity is a living-type entity (eg a cow or a player or anything else that lives, as specifically opposed to non-living entities like paintings, etc).
// Not to be confused with the idea of being alive - see <@link tag EntityTag.is_spawned>.
// This tag is valid for entity type objects.
// -->
registerSpawnedOnlyTag("is_living", (attribute, object) -> {
if (object.entity == null && object.entity_type != null) {
return new ElementTag(object.entity_type.getBukkitEntityType().isAlive());
}
return new ElementTag(object.isLivingEntity());
});

Expand Down

0 comments on commit 6213ba0

Please sign in to comment.