Skip to content

Commit

Permalink
is_player: nonspawned entity support
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Sep 21, 2021
1 parent d59f313 commit d01eeaa
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -598,6 +598,9 @@ public PlayerTag getDenizenPlayer() {
}

public boolean isPlayer() {
if (entity == null) {
return entity_type.getBukkitEntityType() == EntityType.PLAYER && npc == null;
}
return entity instanceof Player && !isNPC();
}

Expand Down Expand Up @@ -2271,7 +2274,7 @@ else if (object.getBukkitEntity() instanceof Hanging) {
// Returns whether the entity is a player.
// Works with offline players.
// -->
registerSpawnedOnlyTag("is_player", (attribute, object) -> {
registerTag("is_player", (attribute, object) -> {
return new ElementTag(object.isPlayer());
});

Expand Down

0 comments on commit d01eeaa

Please sign in to comment.