Skip to content

Add is_enemy tag - #2837

Open
creaturesofhabit wants to merge 3 commits into
DenizenScript:devfrom
creaturesofhabit:is_enemy
Open

Add is_enemy tag#2837
creaturesofhabit wants to merge 3 commits into
DenizenScript:devfrom
creaturesofhabit:is_enemy

Conversation

@creaturesofhabit

@creaturesofhabit creaturesofhabit commented Jul 22, 2026

Copy link
Copy Markdown

For this thread, adds the 1.19+ is_enemy tag to return if the entity is in spigot's enemy interface

@MC-Samuel MC-Samuel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good for your first PR!

// @returns ElementTag(Boolean)
// @group data
// @description
// Returns whether the entity type is an enemy. See <@link url https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Enemy.html>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure the link is necessary, unless you're referencing entities that Spigot defines as "enemies"?

This also requires/justifies the seperate method
Comment on lines +4611 to +4612
case "enemy":
return isEnemyType();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs documentation (the "matchers" section in the EntityTag meta)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did so, though I worry it's a little confusing. Monster is a subset of Enemy but they mostly sound like the same thing, and I'm not sure how to document it more clearly without just giving a list of entities included or excluded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants