Skip to content

Commit cf0e235

Browse files
thibaulthenrydualspiral
authored andcommitted
expose entity tags
1 parent cfbb333 commit cf0e235

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/main/java/org/spongepowered/api/entity/Entity.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,4 +564,31 @@ default Value<Boolean> gravity() {
564564
return getValue(Keys.HAS_GRAVITY).get();
565565
}
566566

567+
/**
568+
* Gets all the tags stored for this entity.
569+
*
570+
* @return This entity's tags
571+
*/
572+
Collection<String> getTags();
573+
574+
/**
575+
* Adds a tag for this entity.
576+
*
577+
* @return Whether the tag is effectively in the set
578+
*/
579+
boolean addTag(String tag);
580+
581+
/**
582+
* Removes a tag for this entity.
583+
*
584+
* @return Whether the tag has effectively been removed
585+
*/
586+
boolean removeTag(String tag);
587+
588+
/**
589+
* Returns whether this entity has the given tag.
590+
*
591+
* @return True if this entity has the given tag.
592+
*/
593+
boolean hasTag(String tag);
567594
}

0 commit comments

Comments
 (0)