From cb12e5d49b587c018e9a606911a680acc8aaaf87 Mon Sep 17 00:00:00 2001 From: Skullfurious <34455502+Skullfurious@users.noreply.github.com> Date: Mon, 2 Feb 2026 02:16:58 -0400 Subject: [PATCH 1/6] Add @example to EntityTag.velocity --- .../java/com/denizenscript/denizen/objects/EntityTag.java | 4 ++++ 1 file changed, 4 insertions(+) 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..a25c223e68 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java @@ -1677,6 +1677,10 @@ else if (object.getLivingEntity() instanceof Steerable) { // @description // Returns the movement velocity of the entity. // Note: Does not accurately calculate player clientside movement velocity. + // @example + // # Narrates the linked player's server side velocity. + // # To run this in-game: /ex narrate + // - narrate // --> registerSpawnedOnlyTag(LocationTag.class, "velocity", (attribute, object) -> { return new LocationTag(object.getBukkitEntity().getVelocity().toLocation(object.getBukkitEntity().getWorld())); From cf1832d2853ae5af739617eef0f4c719441a7a40 Mon Sep 17 00:00:00 2001 From: Skullfurious <34455502+Skullfurious@users.noreply.github.com> Date: Mon, 2 Feb 2026 02:19:05 -0400 Subject: [PATCH 2/6] Add @example to EntityTag.world --- .../java/com/denizenscript/denizen/objects/EntityTag.java | 4 ++++ 1 file changed, 4 insertions(+) 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 a25c223e68..8ee163b386 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java @@ -1692,6 +1692,10 @@ else if (object.getLivingEntity() instanceof Steerable) { // @group location // @description // Returns the world the entity is in. Works with offline players. + // @example + // # Narrates the world's name that the Entity is in. + // # To run this in-game: /ex narrate + // - narrate // --> registerSpawnedOnlyTag(WorldTag.class, "world", (attribute, object) -> { return new WorldTag(object.getBukkitEntity().getWorld()); From 45e1bea9d1c81f7fc8d88ed9b15ecfc8ad75f8f3 Mon Sep 17 00:00:00 2001 From: Skullfurious <34455502+Skullfurious@users.noreply.github.com> Date: Mon, 2 Feb 2026 02:30:08 -0400 Subject: [PATCH 3/6] Add @example to EntityTag.glowing --- .../java/com/denizenscript/denizen/objects/EntityTag.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 8ee163b386..a558d2ed3e 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java @@ -2347,7 +2347,10 @@ 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). + // @example + // # Narrate's if the player is glowing. (True / False) + // - narrate // --> registerSpawnedOnlyTag(ElementTag.class, "glowing", (attribute, object) -> { return new ElementTag(object.getBukkitEntity().isGlowing()); From d57e85b563e985ea4f9d4acb0ea20054c1131048 Mon Sep 17 00:00:00 2001 From: Skullfurious <34455502+Skullfurious@users.noreply.github.com> Date: Mon, 2 Feb 2026 04:06:10 -0400 Subject: [PATCH 4/6] Add @example to several tags and mechanisms. --- .../denizen/objects/EntityTag.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) 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 a558d2ed3e..53fd202341 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java @@ -1257,7 +1257,12 @@ public static void register() { // @returns ElementTag // @deprecated Use 'EntityTag.type' on MC 1.20+. // @description + // Returns the entities type. NOTE: For NPC's it will say "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). + // @example + // # Describes the type of entity at the players cursor in the world. + // # For use in-game: /ex narrate + // - narrate // --> tagProcessor.registerTag(ElementTag.class, "entity_type", (attribute, object) -> { if (NMSHandler.getVersion().isAtMost(NMSVersion.v1_19)) { @@ -1293,6 +1298,12 @@ public static void register() { // @group data // @description // Returns the type of the entity. + // @example + // # Checks if the entity that a player is looking at is also a player. + // # - if == Player: + // # - narrate True + // # - else: + // # - narrate False // --> tagProcessor.registerTag(ElementTag.class, "type", (attribute, object) -> { return new ElementTag(object.getEntityType().getLowercaseName(), true); @@ -1400,6 +1411,13 @@ public static void register() { // Returns the name of the entity. // This can be a player name, an NPC name, a custom_name, or the entity type. // Works with offline players. + // @example + // # Checks if the player's name is "mcmonkey". + // # For use in game: /ex narrate + // - if == mcmonkey: + // - narrate True + // - else: + // - narrate False // --> registerSpawnedOnlyTag(ElementTag.class, "name", (attribute, object) -> { return new ElementTag(object.getName(), true); @@ -1563,6 +1581,10 @@ else if (object.getLivingEntity() instanceof Steerable) { // @group location // @description // Returns the location of the entity's eyes. + // @example + // # Narrates the linked player's eye location. + // # /ex narrate + // - narrate // --> registerSpawnedOnlyTag(LocationTag.class, "eye_location", (attribute, object) -> { return new LocationTag(object.getEyeLocation()); @@ -3903,6 +3925,10 @@ public void adjust(Mechanism mechanism) { // Sets the entity's movement velocity vector. // @tags // + // @example + // # Launches the player upwards by adjusting their velocity. + // # For use in game: /ex adjust velocity: + // - adjust velocity: // --> if (mechanism.matches("velocity") && mechanism.requireObject(LocationTag.class)) { setVelocity(mechanism.valueAsType(LocationTag.class).toVector()); From 56037f525db3f050681c29b8a539ca54107b3af3 Mon Sep 17 00:00:00 2001 From: Skullfurious <34455502+Skullfurious@users.noreply.github.com> Date: Tue, 3 Feb 2026 00:29:45 -0400 Subject: [PATCH 5/6] Adjust examples based on feedback. Entity.world and velocity had examples that weren't very useable in their generated form. --- .../denizen/objects/EntityTag.java | 49 +++++++------------ 1 file changed, 19 insertions(+), 30 deletions(-) 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 53fd202341..1d46ff8d46 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java @@ -10,6 +10,7 @@ import com.denizenscript.denizen.objects.properties.entity.EntityAge; import com.denizenscript.denizen.objects.properties.entity.EntityColor; import com.denizenscript.denizen.objects.properties.entity.EntityTame; +import com.denizenscript.denizen.objects.properties.inventory.InventoryHolder; import com.denizenscript.denizen.objects.properties.item.ItemRawNBT; import com.denizenscript.denizen.scripts.commands.player.DisguiseCommand; import com.denizenscript.denizen.scripts.containers.core.EntityScriptContainer; @@ -39,7 +40,10 @@ import com.denizenscript.denizencore.utilities.text.StringHolder; import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.api.npc.NPC; +import net.citizensnpcs.api.trait.trait.Equipment.EquipmentSlot; +import net.citizensnpcs.api.trait.trait.Inventory; import net.citizensnpcs.npc.ai.NPCHolder; +import net.citizensnpcs.util.Pose; import net.kyori.adventure.nbt.CompoundBinaryTag; import org.bukkit.*; import org.bukkit.block.Block; @@ -56,6 +60,7 @@ import org.bukkit.util.RayTraceResult; import org.bukkit.util.Vector; +import java.rmi.registry.Registry; import java.util.*; import java.util.function.Predicate; import java.util.function.Supplier; @@ -1257,12 +1262,9 @@ public static void register() { // @returns ElementTag // @deprecated Use 'EntityTag.type' on MC 1.20+. // @description - // Returns the entities type. NOTE: For NPC's it will say "PLAYER". + // 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). - // @example - // # Describes the type of entity at the players cursor in the world. - // # For use in-game: /ex narrate - // - narrate // --> tagProcessor.registerTag(ElementTag.class, "entity_type", (attribute, object) -> { if (NMSHandler.getVersion().isAtMost(NMSVersion.v1_19)) { @@ -1298,12 +1300,6 @@ public static void register() { // @group data // @description // Returns the type of the entity. - // @example - // # Checks if the entity that a player is looking at is also a player. - // # - if == Player: - // # - narrate True - // # - else: - // # - narrate False // --> tagProcessor.registerTag(ElementTag.class, "type", (attribute, object) -> { return new ElementTag(object.getEntityType().getLowercaseName(), true); @@ -1411,13 +1407,6 @@ public static void register() { // Returns the name of the entity. // This can be a player name, an NPC name, a custom_name, or the entity type. // Works with offline players. - // @example - // # Checks if the player's name is "mcmonkey". - // # For use in game: /ex narrate - // - if == mcmonkey: - // - narrate True - // - else: - // - narrate False // --> registerSpawnedOnlyTag(ElementTag.class, "name", (attribute, object) -> { return new ElementTag(object.getName(), true); @@ -1582,9 +1571,8 @@ else if (object.getLivingEntity() instanceof Steerable) { // @description // Returns the location of the entity's eyes. // @example - // # Narrates the linked player's eye location. - // # /ex narrate - // - narrate + // # 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()); @@ -1698,11 +1686,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 - // # Narrates the linked player's server side velocity. - // # To run this in-game: /ex narrate - // - narrate + // # 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())); @@ -1715,8 +1709,7 @@ else if (object.getLivingEntity() instanceof Steerable) { // @description // Returns the world the entity is in. Works with offline players. // @example - // # Narrates the world's name that the Entity is in. - // # To run this in-game: /ex narrate + // # Narrates the world name that the linked player is in. // - narrate // --> registerSpawnedOnlyTag(WorldTag.class, "world", (attribute, object) -> { @@ -2370,9 +2363,6 @@ else if (object.getBukkitEntity() instanceof Hanging hanging) { // @group attributes // @description // Returns whether this entity is glowing (Has an outline around them). - // @example - // # Narrate's if the player is glowing. (True / False) - // - narrate // --> registerSpawnedOnlyTag(ElementTag.class, "glowing", (attribute, object) -> { return new ElementTag(object.getBukkitEntity().isGlowing()); @@ -3927,7 +3917,6 @@ public void adjust(Mechanism mechanism) { // // @example // # Launches the player upwards by adjusting their velocity. - // # For use in game: /ex adjust velocity: // - adjust velocity: // --> if (mechanism.matches("velocity") && mechanism.requireObject(LocationTag.class)) { From d98029909884d0b5b3971e293e92a9802267fbf7 Mon Sep 17 00:00:00 2001 From: Skullfurious <34455502+Skullfurious@users.noreply.github.com> Date: Tue, 3 Feb 2026 03:12:52 -0400 Subject: [PATCH 6/6] Removed imports --- .../java/com/denizenscript/denizen/objects/EntityTag.java | 5 ----- 1 file changed, 5 deletions(-) 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 1d46ff8d46..31c96f643f 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/EntityTag.java @@ -10,7 +10,6 @@ import com.denizenscript.denizen.objects.properties.entity.EntityAge; import com.denizenscript.denizen.objects.properties.entity.EntityColor; import com.denizenscript.denizen.objects.properties.entity.EntityTame; -import com.denizenscript.denizen.objects.properties.inventory.InventoryHolder; import com.denizenscript.denizen.objects.properties.item.ItemRawNBT; import com.denizenscript.denizen.scripts.commands.player.DisguiseCommand; import com.denizenscript.denizen.scripts.containers.core.EntityScriptContainer; @@ -40,10 +39,7 @@ import com.denizenscript.denizencore.utilities.text.StringHolder; import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.api.npc.NPC; -import net.citizensnpcs.api.trait.trait.Equipment.EquipmentSlot; -import net.citizensnpcs.api.trait.trait.Inventory; import net.citizensnpcs.npc.ai.NPCHolder; -import net.citizensnpcs.util.Pose; import net.kyori.adventure.nbt.CompoundBinaryTag; import org.bukkit.*; import org.bukkit.block.Block; @@ -60,7 +56,6 @@ import org.bukkit.util.RayTraceResult; import org.bukkit.util.Vector; -import java.rmi.registry.Registry; import java.util.*; import java.util.function.Predicate; import java.util.function.Supplier;