Interface HologramEntity
- All Superinterfaces:
Metadatable
,PersistentStorage.Holder
They're permanently being stored and due to the fact that they don't actually exist they can't be accessed via Bukkit's API. The extensibility of them is very limited, but you're able to do things that you'd otherwise not be able to do, such as having different NPC skins per player.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
exists()
Returns if the hologram still exists and hasn't been removed yet.Returns the instance of the controller (aka the brain) of the hologram.Returns the current type of the controller (aka the brain) of the given hologram.Returns the name that will be displayed above his head.Returns the current location of the hologram.int
Returns the radius in which the hologram gets hidden for the player.Returns the location that will be saved and reused after the plugin restarts.Player[]
Returns all the player who are theoretically able to see him.int
Returns the amount ofgetSeeingPlayersAmount()
getSkin()
Returns the skin object of the hologram.Returns the skin type of the hologram.Returns the location at which the hologram was initially spawned.getWorld()
Returns the world to which the hologram was added toboolean
Returns whether or not a custom display name is given.boolean
Returns whether or not it'll stay even after a reload.void
remove()
Completely removes the hologram.void
setControllerType
(HologramControllerType controller) Set the controller (aka the brain) of the hologram.void
setDisplayName
(String name) Set the name that will be displayed above his head.void
setMinVisibilityRadius
(int distance) Make him only visible at a specific distance.void
setPersistent
(boolean persistent) Returns whether or not it'll disappear after a reload.default void
Teleport him to another location.void
Teleport him to another location.Methods inherited from interface org.bukkit.metadata.Metadatable
getMetadata, hasMetadata, removeMetadata, setMetadata
Methods inherited from interface de.marcely.bedwars.tools.PersistentStorage.Holder
getPersistentStorage
-
Method Details
-
getSkinType
HologramSkinType getSkinType()Returns the skin type of the hologram.- Returns:
- The skin type
-
getSkin
HologramSkin getSkin()Returns the skin object of the hologram.- Returns:
- The skin object
-
getMinVisibilityRadius
int getMinVisibilityRadius()Returns the radius in which the hologram gets hidden for the player. People getting inside the given radius won't see the hologram anymore.This is for instance being used for the holograms above the bed that disappear in a specific range.
- Returns:
- The minimum visibility range
-
setMinVisibilityRadius
void setMinVisibilityRadius(int distance) Make him only visible at a specific distance. People getting inside the given radius won't see the hologram anymore.This is for instance being used for the holograms above the bed that disappear in a specific range.
- Parameters:
distance
- The minimum visibility range
-
getLocation
Location getLocation()Returns the current location of the hologram.- Returns:
- It's location
- See Also:
-
getSpawnLocation
Location getSpawnLocation()Returns the location at which the hologram was initially spawned.- Returns:
- His never changing original spawn location
- See Also:
-
getSavingLocation
Location getSavingLocation()Returns the location that will be saved and reused after the plugin restarts.Generally, the given location is equal to
getLocation()
. It may differ when passing false to- Returns:
- The location that will be saved in a file
- See Also:
-
getWorld
WorldStorage getWorld()Returns the world to which the hologram was added to- Returns:
- The world of the hologram
-
teleport
Teleport him to another location.The new location is also permenantly being saved and reused after a restart.
- Parameters:
loc
- Its new location
-
teleport
Teleport him to another location.- Parameters:
loc
- Its new locationsave
-true
to save it permanently.false
if it shall automatically revert togetSavingLocation()
after a restart
-
getDisplayName
String getDisplayName()Returns the name that will be displayed above his head.- Returns:
- His display name.
null
when none has been set
-
hasDisplayName
boolean hasDisplayName()Returns whether or not a custom display name is given.- Returns:
- If a display name has been set or not
-
setDisplayName
Set the name that will be displayed above his head.- Parameters:
name
- His new display name
-
getSeeingPlayers
Player[] getSeeingPlayers()Returns all the player who are theoretically able to see him. The player does not have to directly look at him, all the hologram has to be is to be inside the servers/clients view distance and got send.- Returns:
- All players who are nearby this hologram
-
getSeeingPlayersAmount
int getSeeingPlayersAmount()Returns the amount ofgetSeeingPlayersAmount()
- Returns:
- The amount of players who are theoretically seeing this hologram
-
isPersistent
boolean isPersistent()Returns whether or not it'll stay even after a reload.Gets stored locally if set to true.
- Returns:
- If the hologram is persistent or not
-
setPersistent
void setPersistent(boolean persistent) Returns whether or not it'll disappear after a reload.Gets stored locally if set to true.
- Parameters:
persistent
- If the hologram is persistent or not
-
setControllerType
Set the controller (aka the brain) of the hologram.It'll automatically and always initiate a new
HologramController
instance that can be accessed usinggetController()
.- Parameters:
controller
- The new type of the controller
-
getControllerType
HologramControllerType getControllerType()Returns the current type of the controller (aka the brain) of the given hologram.- Returns:
- The type of the current set controller
-
getController
HologramController getController()Returns the instance of the controller (aka the brain) of the hologram.There's no global instance per type. Each hologram as his own instance that may be deconstructed and reconstructed at any time using
setControllerType(HologramControllerType)
.- Returns:
- The current instance of the controller
-
exists
boolean exists()Returns if the hologram still exists and hasn't been removed yet.- Returns:
- If it exists
-
remove
void remove()Completely removes the hologram.
-