Package org.bukkit

Interface Nameable

    • Method Detail

      • getCustomName

        @Nullable
        String getCustomName()
        Gets the custom name on a mob or block. If there is no name this method will return null.

        This value has no effect on players, they will always use their real name.

        Returns:
        name of the mob/block or null
      • setCustomName

        void setCustomName​(@Nullable
                           String name)
        Sets a custom name on a mob or block. This name will be used in death messages and can be sent to the client as a nameplate over the mob.

        Setting the name to null or an empty string will clear it.

        This value has no effect on players, they will always use their real name.

        Parameters:
        name - the name to set