diff --git a/docs/scarpet/Full.md b/docs/scarpet/Full.md index d5b34656..fb0c40b7 100644 --- a/docs/scarpet/Full.md +++ b/docs/scarpet/Full.md @@ -2567,12 +2567,18 @@ Returns a 3d vector where the entity is looking. ### `query(e, 'motion')` -Triple of entity's motion vector, `l(motion_x, motion_y, motion_z)` +Triple of entity's motion vector, `l(motion_x, motion_y, motion_z)`. Motion represents the velocity from all the forces +that exert on the given entity. Things that are not 'forces' like voluntary movement, or reaction from the ground are +not part of said forces. ### `query(e, 'motion_x'), query(e, 'motion_y'), query(e, 'motion_z')` Respective component of the entity's motion vector +### `query(e, 'on_ground')` + +Returns `true` if en entity is standing on firm ground and falling down due to that. + ### `query(e, 'name'), query(e, 'display_name'), query(e, 'custom_name'), query(e, 'type')` String of entity name diff --git a/docs/scarpet/api/Entities.md b/docs/scarpet/api/Entities.md index fa9e8c70..3bf577ce 100644 --- a/docs/scarpet/api/Entities.md +++ b/docs/scarpet/api/Entities.md @@ -133,12 +133,18 @@ Returns a 3d vector where the entity is looking. ### `query(e, 'motion')` -Triple of entity's motion vector, `l(motion_x, motion_y, motion_z)` +Triple of entity's motion vector, `l(motion_x, motion_y, motion_z)`. Motion represents the velocity from all the forces +that exert on the given entity. Things that are not 'forces' like voluntary movement, or reaction from the ground are +not part of said forces. ### `query(e, 'motion_x'), query(e, 'motion_y'), query(e, 'motion_z')` Respective component of the entity's motion vector +### `query(e, 'on_ground')` + +Returns `true` if en entity is standing on firm ground and falling down due to that. + ### `query(e, 'name'), query(e, 'display_name'), query(e, 'custom_name'), query(e, 'type')` String of entity name diff --git a/src/main/java/carpet/script/value/EntityValue.java b/src/main/java/carpet/script/value/EntityValue.java index 46bc72a6..a3a8ae61 100644 --- a/src/main/java/carpet/script/value/EntityValue.java +++ b/src/main/java/carpet/script/value/EntityValue.java @@ -281,6 +281,7 @@ public class EntityValue extends Value put("motion_x", (e, a) -> new NumericValue(e.getVelocity().x)); put("motion_y", (e, a) -> new NumericValue(e.getVelocity().y)); put("motion_z", (e, a) -> new NumericValue(e.getVelocity().z)); + put("on_ground", (e, a) -> new NumericValue(e.onGround)); put("name", (e, a) -> new StringValue(e.getName().getString())); put("display_name", (e, a) -> new StringValue(e.getDisplayName().getString())); put("command_name", (e, a) -> new StringValue(e.getEntityName()));