### PlaceholderAPI Placeholder Example Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/README.md Use this format to integrate PlaceholderAPI placeholders within holograms. Ensure PlaceholderAPI is installed. ```plaintext {#ANIM:%player_name% has %player_level% level{/#ANIM}} ``` -------------------------------- ### Hologram Configuration Example Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/configuration.md Example of a new format hologram configuration file. Specifies location, display properties, and page content. ```yaml location: "world:100.5:64.0:100.5" enabled: true permission: "holo.see.shop" flags: - BILLBOARD - SHADOW display-range: 48 update-range: 48 update-interval: 2 facing: 0.0 down-origin: true pages: - lines: - content: "§6Welcome!" height: 0.25 flags: - BILLBOARD offsetX: 0.0 offsetZ: 0.0 facing: 0.0 - content: "#ICON:DIAMOND:1" height: 0.5 - content: "Click me!" height: 0.25 actions: LEFT: - "MESSAGE:You clicked!" - "SOUND:ENTITY_DING" RIGHT: - "COMMAND:give {player} diamond 1" ``` -------------------------------- ### Example: Check Hologram Line Content Type Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Demonstrates how to check if the hologram line content starts with an icon reference. ```java String content = line.getContent(); if (content.startsWith("#ICON:")) { // This is an item icon } ``` -------------------------------- ### Register Custom TextAnimation Example Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Animations.md Example of how to create and register a custom TextAnimation. ```java TextAnimation custom = new CustomTextAnimation(...); animationManager.registerAnimation(custom); ``` -------------------------------- ### Animation Content Example Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Provides an example of how to embed animated content within HologramLine using animation tags. ```plaintext {#ANIM:animation_name}content{/#ANIM} ``` -------------------------------- ### enable() Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Enables the hologram, making it visible to players and starting content updates. ```APIDOC ## enable() ### Description Enable this hologram, show to all players, and start updates. ### Example ```java holo.enable(); EventFactory.fireHologramEnableEvent(holo); ``` ``` -------------------------------- ### Example: Set Hologram Line Content Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Sets new text content for the hologram line. ```java line.setContent("§aNew text content"); ``` -------------------------------- ### Item Content Example Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Shows how to represent items using icons or base64 encoded data in HologramLine. ```plaintext #ICON:material:amount:data or #ICON:base64encoded_item ``` -------------------------------- ### Example: Check and Get Text Content by Type Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Checks if a hologram line is of type TEXT and then retrieves its text content. ```java if (line.getType() == HologramLineType.TEXT) { String text = line.getText(); } ``` -------------------------------- ### Text Content Example Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Demonstrates how to include plain text with formatting codes in HologramLine. ```plaintext Any text here, supports §color codes, §lbold, §nunderline, etc. ``` -------------------------------- ### Entity Content Example Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Illustrates how to specify entities like ARMOR_STAND or ITEM_DISPLAY within HologramLine. ```plaintext #ENTITY:ARMOR_STAND or #ENTITY:ITEM_DISPLAY etc. ``` -------------------------------- ### Initialize DecentHolograms API Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/INDEX.md Shows the initial steps to check if the API is running and obtain the main instance. This is the starting point for interacting with the plugin. ```java DecentHologramsAPI.isRunning() → DecentHologramsAPI.get() → DecentHolograms instance ``` -------------------------------- ### Get Display Module (1.19.4+) Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md Get the DisplayModule for managing display entities, available on Minecraft 1.19.4 and later. Check for null before use as it may not be supported. ```java DisplayModule displayMod = dh.getDisplayModule(); if (displayMod != null) { // Display entities available } ``` -------------------------------- ### Iterate Through Page Lines Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramPage.md Example demonstrating how to iterate through all lines on a page using its size and getLine() method. ```java HologramPage page = holo.getPage(0); for (int i = 0; i < page.size(); i++) { HologramLine line = page.getLine(i); } ``` -------------------------------- ### Animation File Configuration Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/configuration.md Example of a custom animation configuration file. Specifies name, aliases, speed, and pause duration. ```yaml name: "my_animation" alias: - "my_anim" - "custom" speed: 5 pause: 0 # Animation implementation follows... ``` -------------------------------- ### BungeeCord Server Switching Action Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/README.md Example of an Action to connect a player to a different server using BungeeCord. ```java new Action("CONNECT:hub") ``` -------------------------------- ### Create Hologram with Full Configuration Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DHAPI.md Creates a hologram with all possible configuration options, including persistence and initial lines. Use this for complete control over hologram setup. ```Java public static Hologram createHologram(String name, Location location, boolean saveToFile, List lines) ``` -------------------------------- ### Create Hologram Example Plugin Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/README.md This Java plugin demonstrates how to create a hologram using the DecentHolograms API. Ensure DecentHolograms is running before attempting to create a hologram. The hologram is created at a specific location in the 'world'. ```java import eu.decentsoftware.holograms.api.DHAPI; import eu.decentsoftware.holograms.api.DecentHologramsAPI; import org.bukkit.Location; import org.bukkit.plugin.java.JavaPlugin; public class MyPlugin extends JavaPlugin { @Override public void onEnable() { if (!DecentHologramsAPI.isRunning()) { getLogger().warning("DecentHolograms not found!"); setEnabled(false); return; } // Create hologram Location loc = new Location(getServer().getWorld("world"), 100, 64, 100); DHAPI.createHologram("example", loc, true); getLogger().info("Hologram created!"); } } ``` -------------------------------- ### Initialize DecentHolograms Plugin Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md The `enable()` method is called automatically when the plugin starts. It initializes all managers, features, and adapters. This is an internal method and should not be called directly. ```java void enable() ``` -------------------------------- ### Accessing Managers Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/INDEX.md Shows how to get instances of various managers from the DecentHolograms API. ```APIDOC ## Accessing Managers ### Description Retrieves manager instances for different plugin functionalities. ### Methods ```java DecentHolograms.getHologramManager() DecentHolograms.getAnimationManager() DecentHolograms.getFeatureManager() ``` ### Returns - `HologramManager`: An instance of the Hologram Manager. - `AnimationManager`: An instance of the Animation Manager. - `FeatureManager`: An instance of the Feature Manager. ``` -------------------------------- ### Permission Node Action Example Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/README.md How to create a custom permission check within a click action using Java. ```java page.addAction(ClickType.LEFT, new Action("PERMISSION:my.permission.node")); ``` -------------------------------- ### isRunning() Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHologramsAPI.md Checks if the DecentHolograms plugin is currently running and ready for use. It's recommended to call this before attempting to get the plugin instance. ```APIDOC ## isRunning() ### Description Check whether DecentHolograms is currently running and ready for use. ### Method `static boolean` ### Returns `boolean` — True if running, false otherwise ### Example ```java if (DecentHologramsAPI.isRunning()) { DecentHolograms dh = DecentHologramsAPI.get(); // Use the API } ``` ``` -------------------------------- ### Get All Lines in Page Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramPage.md Fetches a list of all HologramLine objects currently present on this page. ```java public List getLines() ``` -------------------------------- ### getDataFolder() Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md Gets the plugin's data folder, located at `plugins/DecentHolograms/`. ```APIDOC ## getDataFolder() ### Description Get plugin data folder path. ### Method ```java public File getDataFolder() ``` ### Returns `File` — Data folder ### Path: `plugins/DecentHolograms/` ``` -------------------------------- ### Check Minecraft Feature Support Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md Example of how to check if the current Minecraft/Bukkit platform supports a specific feature, such as DISPLAY_ENTITIES, using a PlatformAdapter. ```java PlatformAdapter adapter = new BukkitPlatformAdapter(...); if (adapter.getCapabilities().supports(MinecraftFeature.DISPLAY_ENTITIES)) { // Use display entities } ``` -------------------------------- ### DecentHologramsAPI Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/INDEX.md Singleton access point to the plugin's API. Use this to get the plugin instance and check its availability. ```APIDOC ## DecentHologramsAPI ### Description Provides singleton access to the DecentHolograms plugin. This is the primary entry point for all API interactions. ### Methods - `isRunning()`: Checks if the API is available and the plugin is running. - `get()`: Retrieves the plugin instance. - `onLoad()`, `onEnable()`, `onDisable()`: Internal lifecycle methods for plugin management. ``` -------------------------------- ### get() Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHologramsAPI.md Retrieves the singleton instance of the running DecentHolograms plugin. This method should only be called after the plugin has been enabled. It throws an IllegalStateException if the plugin is not running. ```APIDOC ## get() ### Description Get the instance of running DecentHolograms. Must be called after the plugin is enabled. ### Method `static DecentHolograms` ### Returns `DecentHolograms` — The running instance ### Throws `IllegalStateException` — If DecentHologramsAPI is not running ### Note Use `isRunning()` to check availability or listen to `PluginEnableEvent` before calling this method. ### Example ```java try { DecentHolograms decentHolograms = DecentHologramsAPI.get(); HologramManager manager = decentHolograms.getHologramManager(); } catch (IllegalStateException e) { plugin.getLogger().warning("DecentHolograms not loaded"); } ``` ``` -------------------------------- ### ActionType Enum Constants Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Actions.md Details of predefined ActionType constants, their data requirements, and usage examples. ```APIDOC ## ActionType Enum Action types define available click actions. ### Predefined Action Types #### NONE ```java public static final ActionType NONE ``` Do nothing action. **Data:** None **Usage:** No effect #### MESSAGE ```java public static final ActionType MESSAGE ``` Send a message to the player. **Data:** Message text (supports color codes) **Supports:** PAPI placeholders, `{player}` for player name **Example:** ```java new Action("MESSAGE:§aWelcome §e{player}§a!") ``` #### COMMAND ```java public static final ActionType COMMAND ``` Execute a command as the player. **Data:** Command (without leading `/`) **Supports:** PAPI placeholders, `{player}` for player name **Example:** ```java new Action("COMMAND:say Hello from {player}") ``` #### CONSOLE ```java public static final ActionType CONSOLE ``` Execute a command from console. **Data:** Command (without leading `/`) **Supports:** PAPI placeholders, `{player}` for player name **Example:** ```java new Action("CONSOLE:give {player} diamond 1") ``` #### TELEPORT ```java public static final ActionType TELEPORT ``` Teleport player to a location. **Data:** Location in format `world:x:y:z` or `world:x:y:z:yaw:pitch` **Auto-detects:** Current world if not specified **Example:** ```java new Action("TELEPORT:world:100:64:100") new Action("TELEPORT:100:64:100") // Uses player's world new Action("TELEPORT:other_world:200:70:50:180:0") ``` #### CONNECT ```java public static final ActionType CONNECT ``` Connect player to a BungeeCord server. **Data:** Server name **Requires:** BungeeCord **Example:** ```java new Action("CONNECT:hub") ``` #### SOUND ```java public static final ActionType SOUND ``` Play a sound for the player. **Data:** `SOUND_NAME:volume:pitch` (volume and pitch optional) **Defaults:** Volume 1.0, Pitch 1.0 **Example:** ```java new Action("SOUND:ENTITY_ENDERMAN_TELEPORT") new Action("SOUND:ENTITY_ENDERMAN_TELEPORT:0.5:2.0") ``` #### PERMISSION ```java public static final ActionType PERMISSION ``` Check permission, require for action to execute. **Data:** Permission node **Note:** Used internally for permission gating ``` -------------------------------- ### HologramPage Constructor Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramPage.md Creates a new page within a hologram. Pages are indexed starting from 0. ```APIDOC ## HologramPage(Hologram, int) ### Description Create a new page in a hologram. ### Parameters #### Path Parameters - **parent** (Hologram) - Required - Parent hologram - **index** (int) - Required - Page index (0-based) ``` -------------------------------- ### Pair Methods Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md Represents a simple key-value pair, offering methods to get and set both the key and the value. ```APIDOC ## Pair ### Description A generic class representing a simple immutable key-value pair. ### Methods - `getKey()`: Returns the key of the pair. - `getValue()`: Returns the value of the pair. - `setKey(K key)`: Sets the key of the pair. - `setValue(V value)`: Sets the value of the pair. ``` -------------------------------- ### Registering an Action with ClickType Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md Example of how to register an action associated with a specific mouse click type. Ensure the ClickType is imported. ```Java page.addAction(ClickType.LEFT, new Action("MESSAGE:Clicked!")); ``` -------------------------------- ### Apply Placeholders to Hologram Text Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/README.md Use PlaceholderAPI to dynamically insert player-specific information into hologram text. Ensure PlaceholderAPI is installed and configured. ```java String text = "Player: %player_name%"; String replaced = PAPI.setPlaceholders(player, text); DHAPI.addHologramLine(holo, replaced); ``` -------------------------------- ### API Initialization and Access Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/INDEX.md Demonstrates how to check if the plugin is running and obtain an instance of the main API class. ```APIDOC ## API Initialization ### Description Checks if the DecentHolograms plugin is active and retrieves the main API instance. ### Method ```java DecentHologramsAPI.isRunning() DecentHologramsAPI.get() ``` ### Returns - `boolean`: `true` if the plugin is running, `false` otherwise. - `DecentHolograms`: An instance of the main DecentHolograms API class, or `null` if not running. ``` -------------------------------- ### FileConfig Methods Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md Provides methods for interacting with YAML configuration files, allowing users to set, get, and manage configuration values, as well as save or delete the file. ```APIDOC ## FileConfig ### Description Wrapper for YAML configuration files, providing methods to manipulate configuration values. ### Methods - `set(String path, Object value)`: Sets a value at the specified path in the configuration. - `get(String path)`: Retrieves the value at the specified path. - `getString(String path)`: Retrieves the value at the specified path as a String. - `getInt(String path, int defaultValue)`: Retrieves the value at the specified path as an integer, using a default value if not found. - `getStringList(String path)`: Retrieves a list of strings at the specified path. - `getMapList(String path)`: Retrieves a list of maps at the specified path, typically used for nested configurations. - `getConfigurationSection(String path)`: Retrieves a sub-section of the configuration. - `saveData()`: Writes the current configuration to the file on disk. - `delete()`: Deletes the configuration file. ``` -------------------------------- ### Get Value from FileConfig Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md Retrieves a value from the FileConfig at the specified path. Use this to access configuration settings. ```java public Object get(String path) ``` -------------------------------- ### Create a Complete Hologram with Lines and Actions Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md Demonstrates the creation of a shop hologram, including setting its location, display properties, adding text lines, defining click actions, and making it visible to all players. The hologram is also saved for persistence. ```java public class HologramCreator { public static void createShop(DecentHolograms dh) { Location shopLoc = new Location(Bukkit.getWorld("world"), 100, 64, 100); // Create hologram Hologram shop = DHAPI.createHologram("shop", shopLoc, true); shop.setDisplayRange(64); shop.setUpdateInterval(2); shop.addFlags(EnumFlag.BILLBOARD); // Get first page HologramPage page = shop.getPage(0); // Add lines DHAPI.addHologramLine(shop, "§6═══════════════"); DHAPI.addHologramLine(shop, "§e✪ Shop ✪"); DHAPI.addHologramLine(shop, "§cClick to open"); DHAPI.addHologramLine(shop, "§6═══════════════"); // Add click action page.addAction(ClickType.LEFT, new Action("COMMAND:open_shop")); // Show to all shop.showAll(); shop.save(); } } ``` -------------------------------- ### Load HologramLine from File Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Create a HologramLine by loading its configuration from a ConfigurationSection, typically from a YAML file. Requires a parent page and location. ```java public static HologramLine fromFile(@NonNull ConfigurationSection config, @Nullable HologramPage parent, @NonNull Location location) ``` -------------------------------- ### Build DecentHolograms with Gradle Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/README.md Use this command to build the DecentHolograms plugin. The resulting JAR file will be located in the ./plugin/build/libs/ directory. ```bash gradle clean shadowJar ``` -------------------------------- ### Get Animation Manager Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md Obtain the AnimationManager to register custom animations, parse animation strings, or get the current animation step. Useful for creating dynamic text effects. ```java AnimationManager animMgr = dh.getAnimationManager(); TextAnimation typewriter = animMgr.getAnimation("typewriter"); ``` -------------------------------- ### Getting ActionType by Name or Constant Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md Demonstrates two ways to obtain an ActionType instance: by its string name or directly using its static constant. ```Java ActionType msgType = ActionType.getByName("MESSAGE"); ActionType cmdType = ActionType.MESSAGE; ``` -------------------------------- ### Small Server Configuration Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/configuration.md Recommended settings for servers hosting fewer than 100 holograms. Adjust display-range, update-range, and update-interval for optimal performance. ```yaml display-range: 48 update-range: 48 update-interval: 2 ``` -------------------------------- ### Get Value from Pair Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md Retrieves the value from a Pair object. ```java public V getValue() ``` -------------------------------- ### Get Key from Pair Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md Retrieves the key from a Pair object. ```java public K getKey() ``` -------------------------------- ### Get Plugin Instance Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md Obtain the Bukkit JavaPlugin instance. This can be used to access plugin-specific resources like the data folder. ```java JavaPlugin plugin = dh.getPlugin(); File dataFolder = plugin.getDataFolder(); ``` -------------------------------- ### getUpdateInterval() Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Gets the interval in game ticks between hologram content updates. ```APIDOC ## getUpdateInterval() ### Description Get ticks between updates. ### Returns - **int**: Tick count ``` -------------------------------- ### Create HologramLine Instance Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Instantiate a new HologramLine with a parent page, location, and content. The parent can be null for temporary lines. ```java public HologramLine(@Nullable HologramPage parent, @NonNull Location location, @NotNull String content) ``` ```java HologramPage page = holo.getPage(0); HologramLine line = new HologramLine(page, page.getNextLineLocation(), "§cWelcome!"); page.addLine(line); ``` -------------------------------- ### File Configuration Wrapper Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md A wrapper class for YAML configuration files, providing methods to get, set, and manage configuration values. Use this to interact with application settings. ```java public class FileConfig ``` -------------------------------- ### Get DecentHolograms API Instance Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/README.md Retrieve the DecentHolograms plugin instance to access its API. This is the first step to interact with the plugin programmatically. ```java DecentHolograms decentHolograms = DecentHologramsAPI.get(); ``` -------------------------------- ### Get Plugin Data Folder Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md Retrieve the plugin's data folder, located at plugins/DecentHolograms/. This is where configuration files and other plugin data are stored. ```java File dataFolder = dh.getDataFolder(); ``` -------------------------------- ### Constructor Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramManager.md Initializes the hologram manager. This is typically called internally by the plugin. ```APIDOC ## HologramManager(DecentHolograms) ### Description Initializes the hologram manager. ### Parameters #### Path Parameters - **decentHolograms** (DecentHolograms) - Required - Parent plugin instance ``` -------------------------------- ### getDisplayRange() Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Gets the maximum distance in blocks at which players can see the hologram. ```APIDOC ## getDisplayRange() ### Description Get max distance players can see hologram. ### Returns - **int**: Distance in blocks ``` -------------------------------- ### Hologram Constructor with Full Configuration Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Creates a new hologram with all configuration options: name, location, FileConfig, enabled state, and persistence flag. ```APIDOC ## Hologram(String name, Location location, FileConfig config, boolean enabled, boolean saveToFile) ### Description Create a hologram with full configuration. ### Parameters #### Path Parameters - **name** (String) - Required - Unique identifier - **location** (Location) - Required - Spawn location - **config** (FileConfig) - Optional - Custom configuration for the hologram - **enabled** (boolean) - Required - Initial enabled state of the hologram - **saveToFile** (boolean) - Required - Whether to persist to disk ``` -------------------------------- ### Get All Action Types Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Actions.md Retrieves a collection of all registered ActionType constants. ```java public static Collection getActionTypes() ``` -------------------------------- ### Check DecentHolograms Plugin Availability Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md Check if specific DecentHolograms integrations like PlaceholderAPI, HeadDatabase, or BungeeCord are available before using their features. This prevents errors when these plugins are not installed or enabled. ```java IntegrationAvailabilityService integrations = dh.getIntegrationAvailabilityService(); if (integrations.isPlaceholderAPIAvailable()) { // Use PAPI placeholders } if (integrations.isHeadDatabaseAvailable()) { // Use HeadDatabase integration } if (integrations.isBungeeCordAvailable()) { // Use BungeeCord teleports } ``` -------------------------------- ### Get Hologram Pages Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Retrieves a list of all HologramPage objects associated with this hologram. ```java public List getPages() ``` -------------------------------- ### Get API Instance Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/README.md Access the plugin instance to interact with the DecentHolograms API. This is the primary entry point for using the plugin's features. ```APIDOC ## Get API Instance ### Description Access the plugin instance to interact with the DecentHolograms API. This is the primary entry point for using the plugin's features. ### Method ```java DecentHologramsAPI.get() ``` ### Returns - **DecentHolograms** - The plugin instance. ``` -------------------------------- ### Get String List from FileConfig Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md Retrieves a list of strings from the FileConfig at the specified path. Useful for configurations that contain multiple string values. ```java public List getStringList(String path) ``` -------------------------------- ### Get Hologram Line Name Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Retrieves the name or identifier of the hologram line. ```java public String getName() ``` -------------------------------- ### showAll() Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Makes this hologram line visible to all players. ```APIDOC ## showAll() ### Description Show line to all players. ``` -------------------------------- ### Get Configuration Section from FileConfig Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md Retrieves a nested configuration section from the FileConfig at the specified path. Use this to access sub-sections of the configuration. ```java public ConfigurationSection getConfigurationSection(String path) ``` -------------------------------- ### Get DecentHolograms Instance Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHologramsAPI.md Retrieve the singleton instance of the running DecentHolograms plugin. This method should only be called after the plugin has been enabled. An IllegalStateException is thrown if the plugin is not running. ```java public static DecentHolograms get() ``` ```java try { DecentHolograms decentHolograms = DecentHologramsAPI.get(); HologramManager manager = decentHolograms.getHologramManager(); } catch (IllegalStateException e) { plugin.getLogger().warning("DecentHolograms not loaded"); } ``` -------------------------------- ### Get Parent Hologram Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramPage.md Retrieves the parent Hologram object associated with this page. ```java public Hologram getParent() ``` -------------------------------- ### Direct Hologram Manipulation Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/INDEX.md Provides examples of directly manipulating hologram properties and content. This includes setting locations, adding lines to pages, and updating the hologram's display. ```java hologram.setLocation() hologram.getPage().addLine() hologram.updateAll() ``` -------------------------------- ### Get NMS Adapter Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md Obtain the NmsAdapter, which provides a network protocol adapter for version-specific NMS (Net Minecraft Server) functionalities. This is intended for internal use. ```java NmsAdapter adapter = dh.getNmsAdapter(); ``` -------------------------------- ### getUpdateRange() Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Gets the maximum distance in blocks within which the hologram's content will update. ```APIDOC ## getUpdateRange() ### Description Get max distance triggers content updates. ### Returns - **int**: Distance in blocks ``` -------------------------------- ### Get Hologram Page by Index Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DHAPI.md Retrieves a specific page from a hologram using its index. ```java public static HologramPage getHologramPage(Hologram hologram, int index) ``` -------------------------------- ### Replace PlaceholderAPI Placeholders Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/CommonUtilities.md Replaces PlaceholderAPI placeholders in a given text string for a specific player. Ensure the PlaceholderAPI plugin is installed. ```java public static String setPlaceholders(Player player, String text) ``` ```java String msg = PAPI.setPlaceholders(player, "Welcome %player_name%!"); // Result: "Welcome Steve!" (if player name is Steve) ``` -------------------------------- ### Get Hologram Size Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Returns the total number of pages currently managed by the hologram. ```java for (int i = 0; i < holo.size(); i++) { HologramPage page = holo.getPage(i); } ``` -------------------------------- ### Create Hologram with Full Configuration Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Create a hologram with all possible configuration options, including custom config, enabled state, and persistence. ```java public Hologram(@NonNull String name, @NonNull Location location, @Nullable FileConfig config, boolean enabled, boolean saveToFile) ``` -------------------------------- ### Get Hologram Line Location Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Retrieves the current world location of the hologram line. ```java public Location getLocation() ``` -------------------------------- ### ActionType CONNECT Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Actions.md Action to connect the player to a BungeeCord server. Requires BungeeCord to be set up. ```java public static final ActionType CONNECT ``` ```java new Action("CONNECT:hub") ``` -------------------------------- ### Create and Show Hologram Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Instantiate a new hologram with a name and location, then make it visible to players. This constructor saves the hologram to a file. ```java public Hologram(@NonNull String name, @NonNull Location location) ``` ```java Location loc = player.getLocation(); Hologram holo = new Hologram("my_holo", loc); holo.showAll(); ``` -------------------------------- ### Get Page Index Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramPage.md Returns the 0-based index of this page within its parent hologram. ```java public int getIndex() ``` -------------------------------- ### Create Hologram with Initial Lines Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DHAPI.md Creates a hologram with predefined text content. Ideal for holograms that need to display specific messages upon creation. ```Java public static Hologram createHologram(String name, Location location, List lines) ``` ```Java Location loc = new Location(world, 100, 64, 100); List lines = Arrays.asList("§cShop", "§7Click to open"); Hologram shop = DHAPI.createHologram("shop", loc, lines); shop.showAll(); ``` -------------------------------- ### Get Map List from FileConfig Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/types.md Retrieves a list of maps from the FileConfig at the specified path. This is particularly useful for handling complex nested configurations like pages. ```java public List> getMapList(String path) ``` -------------------------------- ### Get Hologram Update Interval Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Retrieves the interval in game ticks between automatic hologram updates. ```java public int getUpdateInterval() ``` -------------------------------- ### Create Hologram with Config and Enabled State Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Create a hologram with a custom configuration and specify its initial enabled state. ```java public Hologram(@NonNull String name, @NonNull Location location, @NonNull FileConfig config, boolean enabled) ``` -------------------------------- ### Get Hologram Display Range Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Returns the maximum distance in blocks at which players can see the hologram. ```java public int getDisplayRange() ``` -------------------------------- ### fromFile Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Loads a hologram from a specified file path. ```APIDOC ## fromFile(String filePath) ### Description Load a hologram from file. ### Method `static Hologram` ### Parameters #### Path Parameters - **filePath** (String) - Required - Path relative to holograms folder ### Response #### Success Response - **Hologram** - The loaded hologram ### Throws - **LocationParseException** - If location cannot be parsed - **IllegalArgumentException** - If file invalid or name duplicate ### Note File name should be in format `hologram_name.yml` or `name.yml` ``` -------------------------------- ### Get Hologram Line Facing (Yaw) Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Retrieves the yaw rotation of the hologram line in degrees. ```java public float getFacing() ``` -------------------------------- ### Get Hologram Line Y Offset Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Retrieves the vertical Y offset of the hologram line from its parent in blocks. ```java public double getOffsetY() ``` -------------------------------- ### Create HologramPage Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramPage.md Instantiate a new HologramPage. Requires the parent Hologram object and a 0-based index for the page. ```java public HologramPage(@NonNull Hologram parent, int index) ``` -------------------------------- ### Get Page Center Location Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramPage.md Retrieves the calculated center coordinates (Location) of the hologram page. ```java public Location getCenter() ``` -------------------------------- ### Load HologramLine from Map Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Create a HologramLine by loading its configuration from a Map. This is used for the newer file format and requires a parent page and location. ```java public static HologramLine fromMap(@NonNull Map map, @Nullable HologramPage parent, @NonNull Location location) ``` -------------------------------- ### Medium Server Configuration Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/configuration.md Recommended settings for servers hosting between 100 and 500 holograms. These values balance performance and resource usage for moderate loads. ```yaml display-range: 32 update-range: 32 update-interval: 3 ``` -------------------------------- ### Get a Hologram by Name Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramManager.md Retrieves a registered hologram by its name. Returns null if the hologram is not found. ```java public Hologram getHologram(@NonNull String name) ``` -------------------------------- ### ReflectionUtil Class Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/CommonUtilities.md Offers Java reflection helpers for accessing Minecraft server NMS (Network Server) components. Use for advanced customization and compatibility. ```java public class ReflectionUtil ``` -------------------------------- ### Get Hologram Line Type Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Retrieves the type of the hologram line (e.g., TEXT, ICON, ENTITY). ```java public HologramLineType getType() ``` -------------------------------- ### Large Server Configuration Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/configuration.md Recommended settings for servers hosting over 500 holograms. Lower ranges and increased intervals help manage resources under heavy load. ```yaml display-range: 24 update-range: 24 update-interval: 5 ``` -------------------------------- ### Java Exception Handling Best Practices Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/errors.md Demonstrates incorrect and correct ways to handle exceptions in Java. Avoid silently ignoring errors; log them or check conditions beforehand. ```java // Bad: Silently ignore try { Hologram holo = DHAPI.createHologram(name, loc); } catch (IllegalArgumentException e) { // Don't do this - error is lost } // Good: Log and handle try { Hologram holo = DHAPI.createHologram(name, loc); } catch (IllegalArgumentException e) { plugin.getLogger().warning("Failed to create hologram: " + e.getMessage()); // Take appropriate action } // Better: Check before attempting if (!name.matches("[a-zA-Z0-9_-]+")) { plugin.getLogger().warning("Invalid hologram name"); return; } Hologram holo = DHAPI.createHologram(name, loc); ``` -------------------------------- ### Get All Click Actions Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramPage.md Retrieves a map containing all click actions defined for this page, categorized by ClickType. ```java public Map> getActions() ``` -------------------------------- ### createHologram(String name, Location location, boolean saveToFile, List lines) Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DHAPI.md Creates a hologram with full configuration, including persistence and initial content. ```APIDOC ## createHologram(String name, Location location, boolean saveToFile, List lines) ### Description Create a hologram with full configuration. ### Method `public static Hologram createHologram(String name, Location location, boolean saveToFile, List lines)` ### Parameters #### Path Parameters - **name** (String) - Required - Unique hologram name - **location** (Location) - Required - Spawn location - **saveToFile** (boolean) - Required - Whether to persist to file - **lines** (List) - Required - Initial text lines ### Response #### Success Response - **Hologram** - The created hologram ``` -------------------------------- ### Get Page Height Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramPage.md Calculates and returns the total height occupied by all lines on the page, measured in blocks. ```java public double getHeight() ``` -------------------------------- ### Get Hologram Update Range Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Returns the maximum distance in blocks within which hologram content updates are triggered. ```java public int getUpdateRange() ``` -------------------------------- ### show(Player) Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Makes this hologram line visible to a specific player. ```APIDOC ## show(Player) ### Description Show line to a specific player. ``` -------------------------------- ### Get Current Animation Step Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Animations.md Retrieves the current step count for animations. This counter is incremented with each animation tick. ```java public long getStep() ``` -------------------------------- ### Create Hologram with Custom Config Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Create a hologram using a custom FileConfig object for advanced configuration. ```java public Hologram(@NonNull String name, @NonNull Location location, @NonNull FileConfig config) ``` -------------------------------- ### Get All Cached Holograms Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Retrieves a collection of all holograms currently stored in the cache. Useful for iterating and updating all holograms. ```java public static Collection getCachedHolograms() ``` ```java for (Hologram holo : Hologram.getCachedHolograms()) { holo.updateAll(); } ``` -------------------------------- ### Create and Display a Hologram Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/README.md Create a new hologram at a specified location and add lines of text to it. The hologram must be explicitly shown to players after creation. ```java Location loc = player.getLocation(); Hologram holo = DHAPI.createHologram("my_holo", loc); DHAPI.addHologramLine(holo, "§cHello!"); holo.showAll(); ``` -------------------------------- ### Get All Cached Hologram Names Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Retrieves an immutable set containing the names of all holograms currently stored in the cache. ```java public static Set getCachedHologramNames() ``` -------------------------------- ### Version.CURRENT and Version.CURRENT_MINECRAFT_VERSION Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/CommonUtilities.md Provides access to the current server version information. ```APIDOC ## Version Constants ### Description Server version detection. ### Constants - **CURRENT** (`Version`) - **CURRENT_MINECRAFT_VERSION** (`String`) ``` -------------------------------- ### Get Hologram Line Z Offset Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Retrieves the horizontal Z offset of the hologram line from its parent in blocks. ```java public double getOffsetZ() ``` -------------------------------- ### Get Hologram Line X Offset Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Retrieves the horizontal X offset of the hologram line from its parent in blocks. ```java public double getOffsetX() ``` -------------------------------- ### Create Hologram Line (Basic) Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DHAPI.md Creates a hologram line without immediately adding it to a page. Useful for preparing lines before attaching them. ```java public static HologramLine createHologramLine(HologramPage parent, String content) ``` -------------------------------- ### Action Constructor from Type and Data Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Actions.md Creates an action using an ActionType constant and an optional data string. ```java public Action(@NonNull ActionType type, @Nullable String data) ``` -------------------------------- ### Get Command Manager Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md Retrieve the CommandManager for handling plugin commands. This is typically used for internal command processing. ```java CommandManager manager = dh.getCommandManager(); ``` -------------------------------- ### Access DecentHolograms Managers Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/INDEX.md Demonstrates how to access the core managers within the DecentHolograms instance. These managers provide access to specific functionalities like holograms, animations, and features. ```java DecentHolograms.getHologramManager() DecentHolograms.getAnimationManager() DecentHolograms.getFeatureManager() ``` -------------------------------- ### Get Location for Next Line Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramPage.md Provides the calculated Location where the next line added to the page would be placed. ```java public Location getNextLineLocation() ``` -------------------------------- ### Create and Configure a Hologram Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/README.md Create a new hologram with a unique identifier and set its properties like display range, update interval, and flags. Ensure a valid location is provided. ```java Hologram holo = DHAPI.createHologram("shop", location, true); holo.setDisplayRange(64); holo.setUpdateInterval(2); holo.addFlags(EnumFlag.BILLBOARD); ``` -------------------------------- ### HologramLine.fromFile Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Loads a hologram line from a YAML configuration section. ```APIDOC ## HologramLine.fromFile(ConfigurationSection, HologramPage, Location) ### Description Load a line from YAML config section. ### Parameters #### Path Parameters - **config** (ConfigurationSection) - Required - The configuration section to load from. - **parent** (HologramPage) - Optional - The parent hologram page. - **location** (Location) - Required - The spawn location for the line. ``` -------------------------------- ### Get All Registered Holograms Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramManager.md Retrieves a collection of all holograms currently managed by the HologramManager. This can be used to iterate over all active holograms. ```java public Collection getHolograms() ``` -------------------------------- ### Hologram Constructor with FileConfig and Enabled State Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Creates a new hologram with a specified name, location, FileConfig, and an enabled state. ```APIDOC ## Hologram(String name, Location location, FileConfig config, boolean enabled) ### Description Create a hologram with config and enabled state. ### Parameters #### Path Parameters - **name** (String) - Required - Unique identifier - **location** (Location) - Required - Spawn location - **config** (FileConfig) - Required - Custom configuration for the hologram - **enabled** (boolean) - Required - Initial enabled state of the hologram ``` -------------------------------- ### createHologram(String name, Location location, List lines) Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DHAPI.md Creates a hologram that is initialized with a list of text lines. ```APIDOC ## createHologram(String name, Location location, List lines) ### Description Create a hologram with initial content lines. ### Method `public static Hologram createHologram(String name, Location location, List lines)` ### Parameters #### Path Parameters - **name** (String) - Required - Unique hologram name - **location** (Location) - Required - Spawn location - **lines** (List) - Required - Initial text lines ### Request Example ```java Location loc = new Location(world, 100, 64, 100); List lines = Arrays.asList("§cShop", "§7Click to open"); Hologram shop = DHAPI.createHologram("shop", loc, lines); shop.showAll(); ``` ### Response #### Success Response - **Hologram** - The created hologram ``` -------------------------------- ### Get Hologram Page by Index Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Retrieves a specific HologramPage using its 0-based index. Returns null if the index is out of bounds. ```java public HologramPage getPage(int index) ``` -------------------------------- ### ActionType COMMAND Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Actions.md Action to execute a command as the player. The command should not include the leading '/'. Supports PAPI placeholders and {player} for player name. ```java public static final ActionType COMMAND ``` ```java new Action("COMMAND:say Hello from {player}") ``` -------------------------------- ### Get Cached Hologram by Name Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Retrieves a hologram from the global cache using its name. Returns null if the hologram is not found. ```java public static Hologram getCachedHologram(@NonNull String name) ``` ```java Hologram holo = Hologram.getCachedHologram("shop"); ``` -------------------------------- ### Get TextAnimation by Name Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Animations.md Retrieves a registered TextAnimation using its name. Returns null if no animation with the specified name is found. ```java public TextAnimation getAnimation(@NonNull String name) ``` -------------------------------- ### Add Hologram Page with Initial Content Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DHAPI.md Adds a new page to a hologram with predefined lines of content. ```java public static HologramPage addHologramPage(Hologram hologram, List lines) ``` -------------------------------- ### getLogger() Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md Retrieves the plugin's Java logger for outputting messages. Example: `dh.getLogger().info("Custom message");` ```APIDOC ## getLogger() ### Description Get Java logger. ### Method ```java public Logger getLogger() ``` ### Returns `Logger` — Plugin logger ### Example: ```java dh.getLogger().info("Custom message"); ``` ``` -------------------------------- ### HologramLine Constructor Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Creates a new hologram line with specified parent, location, and content. The parent can be null for temporary lines. ```APIDOC ## HologramLine(HologramPage, Location, String) ### Description Create a new hologram line. ### Parameters #### Path Parameters - **parent** (HologramPage) - Optional - Parent page (can be null for temporary lines) - **location** (Location) - Required - Spawn location - **content** (String) - Required - Line content (text, #ICON:..., or entity) ### Request Example ```java HologramPage page = holo.getPage(0); HologramLine line = new HologramLine(page, page.getNextLineLocation(), "§cWelcome!"); page.addLine(line); ``` ``` -------------------------------- ### Hologram Constructor with FileConfig Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Hologram.md Creates a new hologram with a given name, location, and a custom FileConfig for configuration. ```APIDOC ## Hologram(String name, Location location, FileConfig config) ### Description Create a hologram with custom config. ### Parameters #### Path Parameters - **name** (String) - Required - Unique identifier - **location** (Location) - Required - Spawn location - **config** (FileConfig) - Required - Custom configuration for the hologram ``` -------------------------------- ### Get Hologram Line Permission Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Retrieves the permission node required to see this hologram line. Returns null if no permission is required. ```java public String getPermission() ``` -------------------------------- ### Initialize HologramManager Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramManager.md Initializes the hologram manager with the parent plugin instance. This is the constructor for the HologramManager class. ```java public HologramManager(DecentHolograms decentHolograms) ``` -------------------------------- ### Apply Animations via Content String (Java) Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Animations.md Use the {#ANIM:TYPE} and {/#ANIM} tags within hologram content strings to apply predefined animations like typewriter or wave effects. Nesting animations is not recommended. ```java DHAPI.addHologramLine(holo, "{#ANIM:TYPEWRITER}Hello World{/#ANIM}"); ``` ```java DHAPI.addHologramLine(holo, "{#ANIM:WAVE}Wavy{/#ANIM}"); ``` ```java DHAPI.addHologramLine(holo, "{#ANIM:SCROLL}Scrolling{/#ANIM}"); ``` -------------------------------- ### Get Hologram Line Content Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/HologramLine.md Retrieves the raw content string of the hologram line. This can be text, an icon reference, or an entity type. ```java public String getContent() ``` -------------------------------- ### Check API Availability Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/README.md Check if the DecentHolograms API is running and get an instance of the API. This should be done before attempting to use other API methods. ```java if (DecentHologramsAPI.isRunning()) { DecentHolograms dh = DecentHologramsAPI.get(); } ``` -------------------------------- ### Action Methods Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Actions.md Details the methods available for interacting with Action objects, including retrieving type and data, setting data, executing the action, and converting to a string. ```APIDOC ## getType() ### Description Retrieves the type of the action. ### Returns - `ActionType` — The type of the action. ## getData() ### Description Retrieves the data associated with the action. ### Returns - `String` — The data string, or null if no data is present. ## setData(String) ### Description Sets the data for the action. ### Parameters #### Path Parameters - **data** (String) - Required - The data string to set for the action. ## execute(Player) ### Description Executes the defined action for a given player. ### Parameters #### Path Parameters - **player** (Player) - Required - The target player for whom the action will be executed. ### Returns - `boolean` — True if the action was successfully executed, false otherwise. ## toString() ### Description Converts the action object back into its string representation. ### Returns - `String` — The string representation of the action. ``` -------------------------------- ### ActionType CONSOLE Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/Actions.md Action to execute a command from the console. The command should not include the leading '/'. Supports PAPI placeholders and {player} for player name. ```java public static final ActionType CONSOLE ``` ```java new Action("CONSOLE:give {player} diamond 1") ``` -------------------------------- ### Get Plugin Logger Source: https://github.com/decentsoftware-eu/decentholograms/blob/main/_autodocs/api-reference/DecentHolograms.md Obtain the Java logger instance for the DecentHolograms plugin. Use this to log custom messages or debug information. ```java dh.getLogger().info("Custom message"); ```