Class RareEntityNameplate

java.lang.Object
valorless.rarespawns.datamodels.RareEntityNameplate

public class RareEntityNameplate extends Object
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
    Modifier and Type
    Field
    Description
    final org.bukkit.entity.TextDisplay
    The TextDisplay entity used for the nameplate.
    final org.bukkit.entity.LivingEntity
    The rare entity this nameplate is attached to.
    The Bukkit runnable task ID for updating the nameplate.
  • Constructor Summary

    Constructors
    Constructor
    Description
    RareEntityNameplate(org.bukkit.entity.LivingEntity rareEntity, EntityData data)
    Constructs a RareEntityNameplate for the given entity and data.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes the nameplate entity and unregisters it from EntityCreator.
    static byte
    toByteOpacity(int opacity)
    Converts an opacity value (0-255) to a byte for use in ARGB color.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • rare

      public final org.bukkit.entity.LivingEntity rare
      The rare entity this nameplate is attached to.
    • nameplate

      public final org.bukkit.entity.TextDisplay nameplate
      The TextDisplay entity used for the nameplate.
    • runnable

      public Integer runnable
      The Bukkit runnable task ID for updating the nameplate.
  • Constructor Details

    • RareEntityNameplate

      public RareEntityNameplate(org.bukkit.entity.LivingEntity rareEntity, EntityData data)
      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).