Package valorless.rarespawns.datamodels
Class RareEntityNameplate
java.lang.Object
valorless.rarespawns.datamodels.RareEntityNameplate
Represents a custom nameplate for a rare entity in RareSpawns.
Handles creation, updating, and removal of the floating text display above rare entities.
Nameplates are updated in real-time to follow the entity and reflect its state (e.g., invisibility, taming).
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRareEntityNameplate(org.bukkit.entity.LivingEntity rareEntity, EntityData data) Constructs a RareEntityNameplate for the given entity and data. -
Method Summary
Modifier and TypeMethodDescriptionvoidremove()Removes the nameplate entity and unregisters it from EntityCreator.static bytetoByteOpacity(int opacity) Converts an opacity value (0-255) to a byte for use in ARGB color.
-
Field Details
-
rare
public final org.bukkit.entity.LivingEntity rareThe rare entity this nameplate is attached to. -
nameplate
public final org.bukkit.entity.TextDisplay nameplateThe TextDisplay entity used for the nameplate. -
runnable
The Bukkit runnable task ID for updating the nameplate.
-
-
Constructor Details
-
RareEntityNameplate
Constructs a RareEntityNameplate for the given entity and data. Spawns a TextDisplay, sets its properties, and schedules updates.- Parameters:
rareEntity- The rare entity to attach the nameplate to.data- The EntityData containing nameplate settings.
-
-
Method Details
-
remove
public void remove()Removes the nameplate entity and unregisters it from EntityCreator. -
toByteOpacity
public static byte toByteOpacity(int opacity) Converts an opacity value (0-255) to a byte for use in ARGB color.- Parameters:
opacity- The opacity value (0-255).- Returns:
- The scaled byte value (0-127).
-