added ability to modify age of entities

This commit is contained in:
gnembon committed 2020-02-10 00:51:56 -04:00
1 parent 770ba7ced1
commit 229a82da90
2 files changed
+7 -3

No files matched your search

@@ -517,6 +517,7 @@ public class EntityValue extends Value
private static final Map<String, BiConsumer<Entity, Value>> featureModifiers = new HashMap<String, BiConsumer<Entity, Value>>() {{
put("remove", (entity, value) -> entity.remove());
put("age", (e, v) -> e.age = Math.abs((int)NumericValue.asNumber(v).getLong()) );
put("health", (e, v) -> { if (e instanceof LivingEntity) ((LivingEntity) e).setHealth((float) NumericValue.asNumber(v).getDouble()); });
put("kill", (e, v) -> e.kill());
put("location", (e, v) ->