diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java index 4ce44f74ab..31c96f643f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java @@ -1257,6 +1257,8 @@ public static void register() { // @returns ElementTag // @deprecated Use 'EntityTag.type' on MC 1.20+. // @description + // Returns the entities type. + // Note: For NPC's this will return the value "Player". // Deprecated in favor of <@link tag EntityTag.type> on MC 1.20+, which returns entity type names as specified by Mojang (scripts using this may need an update when switching). // --> tagProcessor.registerTag(ElementTag.class, "entity_type", (attribute, object) -> { @@ -1563,6 +1565,9 @@ else if (object.getLivingEntity() instanceof Steerable) { // @group location // @description // Returns the location of the entity's eyes. + // @example + // # Shoots a snowball from the direct center of the players screen. + // - shoot snowball origin: destination: speed:1 // --> registerSpawnedOnlyTag(LocationTag.class, "eye_location", (attribute, object) -> { return new LocationTag(object.getEyeLocation()); @@ -1676,7 +1681,17 @@ else if (object.getLivingEntity() instanceof Steerable) { // @mechanism EntityTag.velocity // @description // Returns the movement velocity of the entity. + // There is a constant negative velocity of '-0.08' when standing on a block. // Note: Does not accurately calculate player clientside movement velocity. + // @example + // # Checks if the player is jumping: + // - if : + // - narrate "The player is jumping!" + // - else: + // - narrate "The player is not jumping!" + // @example + // # Makes the player jump: + // - adjust velocity: // --> registerSpawnedOnlyTag(LocationTag.class, "velocity", (attribute, object) -> { return new LocationTag(object.getBukkitEntity().getVelocity().toLocation(object.getBukkitEntity().getWorld())); @@ -1688,6 +1703,9 @@ else if (object.getLivingEntity() instanceof Steerable) { // @group location // @description // Returns the world the entity is in. Works with offline players. + // @example + // # Narrates the world name that the linked player is in. + // - narrate // --> registerSpawnedOnlyTag(WorldTag.class, "world", (attribute, object) -> { return new WorldTag(object.getBukkitEntity().getWorld()); @@ -2339,7 +2357,7 @@ else if (object.getBukkitEntity() instanceof Hanging hanging) { // @mechanism EntityTag.glowing // @group attributes // @description - // Returns whether this entity is glowing. + // Returns whether this entity is glowing (Has an outline around them). // --> registerSpawnedOnlyTag(ElementTag.class, "glowing", (attribute, object) -> { return new ElementTag(object.getBukkitEntity().isGlowing()); @@ -3892,6 +3910,9 @@ public void adjust(Mechanism mechanism) { // Sets the entity's movement velocity vector. // @tags // + // @example + // # Launches the player upwards by adjusting their velocity. + // - adjust velocity: // --> if (mechanism.matches("velocity") && mechanism.requireObject(LocationTag.class)) { setVelocity(mechanism.valueAsType(LocationTag.class).toVector());