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 SummaryModifier and TypeMethodDescriptionbooleanexists()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.intReturns the radius in which the hologram gets hidden for the player.Returns the Predicate that returns whether it should be visible to a 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.intReturns 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 tobooleanReturns whether or not a custom display name is given.booleanReturns whether or not it'll stay even after a reload.voidremove()Completely removes the hologram.voidsetControllerType(HologramControllerType controller) Set the controller (aka the brain) of the hologram.voidsetDisplayName(String name) Set the name that will be displayed above his head.voidsetMinVisibilityRadius(int distance) Make him only visible at a specific distance.voidsetPerPlayerVisibility(@Nullable Predicate<Player> predicate) Set a Predicate that returns whether it should be visible to a player.voidsetPersistent(boolean persistent) Returns whether or not it'll disappear after a reload.default voidTeleport him to another location.voidTeleport him to another location.voidDynamically updates the visibility of the hologram for each player.Methods inherited from interface org.bukkit.metadata.MetadatablegetMetadata, hasMetadata, removeMetadata, setMetadataMethods inherited from interface de.marcely.bedwars.tools.PersistentStorage.HoldergetPersistentStorage
- 
Method Details- 
getSkinTypeHologramSkinType getSkinType()Returns the skin type of the hologram.- Returns:
- The skin type
 
- 
getSkinHologramSkin getSkin()Returns the skin object of the hologram.- Returns:
- The skin object
 
- 
getMinVisibilityRadiusint 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
 
- 
setMinVisibilityRadiusvoid 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
 
- 
getLocationLocation getLocation()Returns the current location of the hologram.- Returns:
- It's location
- See Also:
 
- 
getSpawnLocationLocation getSpawnLocation()Returns the location at which the hologram was initially spawned.- Returns:
- His never changing original spawn location
- See Also:
 
- 
getSavingLocationLocation 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:
 
- 
getWorldWorldStorage getWorld()Returns the world to which the hologram was added to- Returns:
- The world of the hologram
 
- 
teleportTeleport him to another location.The new location is also permenantly being saved and reused after a restart. - Parameters:
- loc- Its new location
 
- 
teleportTeleport him to another location.- Parameters:
- loc- Its new location
- save-- trueto save it permanently.- falseif it shall automatically revert to- getSavingLocation()after a restart
 
- 
getDisplayNameString getDisplayName()Returns the name that will be displayed above his head.- Returns:
- His display name. nullwhen none has been set
 
- 
hasDisplayNameboolean hasDisplayName()Returns whether or not a custom display name is given.- Returns:
- If a display name has been set or not
 
- 
setDisplayNameSet the name that will be displayed above his head.- Parameters:
- name- His new display name
 
- 
getSeeingPlayersPlayer[] 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
 
- 
getSeeingPlayersAmountint getSeeingPlayersAmount()Returns the amount ofgetSeeingPlayersAmount()- Returns:
- The amount of players who are theoretically seeing this hologram
 
- 
isPersistentboolean 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
 
- 
setPersistentvoid 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
 
- 
setControllerTypeSet the controller (aka the brain) of the hologram.It'll automatically and always initiate a new HologramControllerinstance that can be accessed usinggetController().- Parameters:
- controller- The new type of the controller
 
- 
getControllerTypeHologramControllerType getControllerType()Returns the current type of the controller (aka the brain) of the given hologram.- Returns:
- The type of the current set controller
 
- 
getControllerHologramController 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
 
- 
existsboolean exists()Returns if the hologram still exists and hasn't been removed yet.- Returns:
- If it exists
 
- 
setPerPlayerVisibilitySet a Predicate that returns whether it should be visible to a player.The Predicate will be called on an async thread and if it returns true, the player will be able to see the hologram. If it returnsfalse, the hologram will be hidden. It will be called either when a player comes nearby or ifupdatePerPlayerVisibility()is called.- Parameters:
- predicate- The Predicate that returns whether the hologram should be visible.- nullto remove the current one
 
- 
getPerPlayerVisibilityReturns the Predicate that returns whether it should be visible to a player.The Predicate will be called on an async thread and if it returns true, the player will be able to see the hologram. If it returnsfalse, the hologram will be hidden. It will be called either when a player comes nearby or ifupdatePerPlayerVisibility()is called.- Returns:
- The Predicate that returns whether the hologram should be visible. nullif none has been set
 
- 
updatePerPlayerVisibilityvoid updatePerPlayerVisibility()Dynamically updates the visibility of the hologram for each player.This will call the Predicate that has been set using setPerPlayerVisibility(Predicate)for all players within the next tick in which the hologram is being updated (which could be a few seconds)
- 
removevoid remove()Completely removes the hologram.
 
-