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..9a221b902d 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,7 @@ public static void register() { // @returns ElementTag // @deprecated Use 'EntityTag.type' on MC 1.20+. // @description + // Returns the entities type. // 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 +1564,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: speed:2 // --> registerSpawnedOnlyTag(LocationTag.class, "eye_location", (attribute, object) -> { return new LocationTag(object.getEyeLocation()); @@ -1676,7 +1680,14 @@ else if (object.getLivingEntity() instanceof Steerable) { // @mechanism EntityTag.velocity // @description // Returns the movement velocity of the entity. + // Will return a constant negative velocity when standing on a solid block. // Note: Does not accurately calculate player clientside movement velocity. + // @example + // # Checks if the player is moving upwards. + // - if > 0: + // - narrate "The player is moving upwards!" + // - else: + // - narrate "The player is not moving upwards!" // --> registerSpawnedOnlyTag(LocationTag.class, "velocity", (attribute, object) -> { return new LocationTag(object.getBukkitEntity().getVelocity().toLocation(object.getBukkitEntity().getWorld())); @@ -1688,6 +1699,9 @@ else if (object.getLivingEntity() instanceof Steerable) { // @group location // @description // Returns the world the entity is in. Works with offline players. + // @example + // # Narrates the name of the world that the linked player is in. + // - narrate // --> registerSpawnedOnlyTag(WorldTag.class, "world", (attribute, object) -> { return new WorldTag(object.getBukkitEntity().getWorld()); @@ -2339,7 +2353,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 +3906,9 @@ public void adjust(Mechanism mechanism) { // Sets the entity's movement velocity vector. // @tags // + // @example + // # Launches the player upwards. + // - adjust velocity:0,1,0 // --> if (mechanism.matches("velocity") && mechanism.requireObject(LocationTag.class)) { setVelocity(mechanism.valueAsType(LocationTag.class).toVector()); @@ -4655,3 +4672,4 @@ public boolean advancedMatches(String text, TagContext context) { return false; } } +