Fixed scarpet entity value querying invulnerable for players

This commit is contained in:
replaceitem authored and gnembon committed 2025-05-20 19:14:55 +02:00
1 parent bc42949e0f
commit c34751b365
1 file changed
+1 -1
@@ -501,7 +501,7 @@ public class EntityValue extends Value
put("immune_to_fire", (e, a) -> BooleanValue.of(e.fireImmune()));
put("immune_to_frost", (e, a) -> BooleanValue.of(!e.canFreeze()));
put("invulnerable", (e, a) -> BooleanValue.of(e.isInvulnerable()));
put("invulnerable", (e, a) -> BooleanValue.of(e instanceof Player player ? player.getAbilities().invulnerable : e.isInvulnerable()));
put("dimension", (e, a) -> nameFromRegistryId(e.level().dimension().location())); // getDimId
put("height", (e, a) -> new NumericValue(e.getDimensions(Pose.STANDING).height()));
put("width", (e, a) -> new NumericValue(e.getDimensions(Pose.STANDING).width()));