### Get Custom Nameplates API Instance and Player (Java) Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Demonstrates how to obtain the CustomNameplatesAPI singleton instance and retrieve a CNPlayer object by UUID to interact with player-specific features. This is the primary entry point for using the plugin's API. ```java import net.momirealms.customnameplates.api.CustomNameplatesAPI; import net.momirealms.customnameplates.api.CustomNameplates; import net.momirealms.customnameplates.api.CNPlayer; import java.util.UUID; // Get the API instance CustomNameplatesAPI api = CustomNameplatesAPI.getInstance(); // Get the plugin instance CustomNameplates plugin = api.plugin(); // Get a player by UUID UUID playerUUID = UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5"); CNPlayer player = api.getPlayer(playerUUID); if (player != null && player.isOnline()) { System.out.println("Player " + player.name() + " is online"); } ``` -------------------------------- ### Manage Placeholders with CustomNameplates API Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Shows how to detect placeholders within a string, retrieve registered placeholder details, get cached placeholder values for specific players, unregister placeholders, and refresh all active placeholders using the CustomNameplates API. Requires the CustomNameplates API library. ```java import net.momirealms.customnameplates.api.placeholder.Placeholder; import java.util.List; // Detect placeholders in a string String text = "Hello %player_name%, your health is %player_health%"; List detectedPlaceholders = placeholderManager.detectPlaceholders(text); System.out.println("Found placeholders: " + detectedPlaceholders); // Get a registered placeholder Placeholder placeholder = placeholderManager.getRegisteredPlaceholder("%player_health%"); if (placeholder != null) { System.out.println("Placeholder ID: " + placeholder.id()); int refreshInterval = placeholderManager.getRefreshInterval(placeholder.id()); System.out.println("Refresh interval: " + refreshInterval + " ticks"); } // Get cached placeholder value for a player CNPlayer player = api.getPlayer(playerUUID); if (player != null && placeholder instanceof PlayerPlaceholder) { String value = player.getCachedPlayerValue((PlayerPlaceholder) placeholder); System.out.println("Cached value: " + value); } // Unregister a placeholder placeholderManager.unregisterPlaceholder("%custom_placeholder%"); // Refresh all placeholders placeholderManager.refreshPlaceholders(); ``` -------------------------------- ### Working with CNPlayer Objects Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Details on how to retrieve and manipulate player data using CNPlayer objects, including position, state, and permissions. ```APIDOC ## Working with CNPlayer Objects ### Description Retrieve and manipulate player data, including position, state, and custom nameplate settings, by interacting with `CNPlayer` objects. This includes accessing player information, checking their current state (crouching, flying), and verifying permissions. ### Method Java API Call ### Endpoint N/A ### Parameters N/A ### Request Example ```java import net.momirealms.customnameplates.api.CNPlayer; import net.momirealms.customnameplates.api.CustomNameplatesAPI; import java.util.UUID; UUID playerUUID = UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5"); CNPlayer player = CustomNameplatesAPI.getInstance().getPlayer(playerUUID); if (player != null && player.isLoaded()) { // Get player information String name = player.name(); String world = player.world(); Vector3 position = player.position(); // Assuming Vector3 is a defined class int entityId = player.entityID(); // Check player state boolean isCrouching = player.isCrouching(); boolean isFlying = player.isFlying(); boolean isSpectator = player.isSpectator(); double scale = player.scale(); int air = player.remainingAir(); // Check permissions if (player.hasPermission("customnameplates.vip")) { System.out.println("Player has VIP permission"); } // Get nearby players Collection nearbyPlayers = player.nearbyPlayers(); System.out.println("Players nearby: " + nearbyPlayers.size()); } ``` ### Response N/A ``` -------------------------------- ### Project Integration Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Instructions on how to add the Custom Nameplates plugin as a dependency to your Gradle project. ```APIDOC ## Project Integration ### Description Add the repository and dependency to your Gradle build file to integrate the Custom Nameplates plugin into your project. ### Method Gradle Build Script Configuration ### Endpoint N/A ### Parameters N/A ### Request Example ```kotlin repositories { maven("https://repo.momirealms.net/releases/") } dependencies { compileOnly("net.momirealms:custom-nameplates:3.0.19") } ``` ### Response N/A ``` -------------------------------- ### Retrieve and Use CNPlayer Data (Java) Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Shows how to access detailed information and state of a CNPlayer object, including their name, location, entity ID, and various player states like crouching or flying. It also demonstrates checking permissions and finding nearby players. ```java import net.momirealms.customnameplates.api.CNPlayer; import net.momirealms.customnameplates.api.CustomNameplatesAPI; import java.util.Collection; import java.util.UUID; import org.joml.Vector3; UUID playerUUID = UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5"); CNPlayer player = CustomNameplatesAPI.getInstance().getPlayer(playerUUID); if (player != null && player.isLoaded()) { // Get player information String name = player.name(); String world = player.world(); Vector3 position = player.position(); int entityId = player.entityID(); // Check player state boolean isCrouching = player.isCrouching(); boolean isFlying = player.isFlying(); boolean isSpectator = player.isSpectator(); double scale = player.scale(); int air = player.remainingAir(); // Check permissions if (player.hasPermission("customnameplates.vip")) { System.out.println("Player has VIP permission"); } // Get nearby players Collection nearbyPlayers = player.nearbyPlayers(); System.out.println("Players nearby: " + nearbyPlayers.size()); } ``` -------------------------------- ### Manage Player Data Storage in Java Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Illustrates how to interact with the storage system to save and load player data. This includes retrieving storage information, converting `PlayerData` objects to and from JSON and byte arrays, and obtaining the data storage provider. ```java import net.momirealms.customnameplates.api.storage.StorageManager; import net.momirealms.customnameplates.api.storage.data.PlayerData; import net.momirealms.customnameplates.api.storage.DataStorageProvider; import java.util.UUID; CustomNameplates plugin = api.plugin(); StorageManager storageManager = plugin.getStorageManager(); // Get storage information String serverId = storageManager.serverID(); boolean redisEnabled = storageManager.isRedisEnabled(); System.out.println("Server ID: " + serverId); System.out.println("Redis enabled: " + redisEnabled); // Get the current data storage provider DataStorageProvider dataSource = storageManager.dataSource(); // Convert player data to JSON UUID playerUUID = UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5"); PlayerData playerData = new PlayerData(playerUUID); playerData.setNameplate("epic_nameplate"); playerData.setBubble("custom_bubble"); String json = storageManager.toJson(playerData); System.out.println("Player data as JSON: " + json); // Convert JSON back to player data PlayerData loadedData = storageManager.fromJson(playerUUID, json); System.out.println("Loaded nameplate: " + loadedData.nameplate()); System.out.println("Loaded bubble: " + loadedData.bubble()); // Convert to/from byte array for binary storage byte[] bytes = storageManager.toBytes(playerData); PlayerData fromBytes = storageManager.fromBytes(playerUUID, bytes); System.out.println("Data serialization successful"); ``` -------------------------------- ### Use Parsed Requirements in Java Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Shows how to parse requirement configurations from YAML sections and check if players meet these requirements. It covers parsing multiple requirements and checking them against a single player or relationally between two players. Also demonstrates unregistering a requirement. ```java import dev.dejvokep.boostedyaml.block.implementation.Section; import net.momirealms.customnameplates.api.requirement.Requirement; // Parse requirements from YAML configuration section Section configSection = ConfigManager.getMainConfig().getSection("features.nameplate.requirements"); if (configSection != null) { Requirement[] requirements = requirementManager.parseRequirements(configSection); System.out.println("Parsed " + requirements.length + " requirements"); // Check if a player meets the requirements CNPlayer player = api.getPlayer(playerUUID); if (player != null && player.isMet(requirements)) { System.out.println("Player meets all requirements"); } // Check relational requirements between two players CNPlayer otherPlayer = api.getPlayer(otherPlayerUUID); if (player != null && otherPlayer != null) { if (player.isMet(otherPlayer, requirements)) { System.out.println("Players meet relational requirements"); } } } // Unregister a requirement requirementManager.unregisterRequirement("custom_permission"); ``` -------------------------------- ### API Instance and Player Retrieval Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Demonstrates how to obtain the CustomNameplatesAPI instance and retrieve player objects using their UUID. ```APIDOC ## API Instance and Player Retrieval ### Description Access the CustomNameplatesAPI singleton instance to interact with the plugin's features. You can then use this instance to retrieve player objects by their unique identifier (UUID). ### Method Java API Call ### Endpoint N/A ### Parameters N/A ### Request Example ```java import net.momirealms.customnameplates.api.CustomNameplatesAPI; import net.momirealms.customnameplates.api.CustomNameplates; // Get the API instance CustomNameplatesAPI api = CustomNameplatesAPI.getInstance(); // Get the plugin instance CustomNameplates plugin = api.plugin(); // Get a player by UUID UUID playerUUID = UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5"); CNPlayer player = api.getPlayer(playerUUID); if (player != null && player.isOnline()) { System.out.println("Player " + player.name() + " is online"); } ``` ### Response N/A ``` -------------------------------- ### Retrieve Background and Bubble Configurations (Java) Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Retrieve background and bubble configurations by their respective IDs. This allows developers to access and utilize custom background or chat bubble elements defined within the plugin's configuration. ```java import net.momirealms.customnameplates.api.feature.background.Background; import net.momirealms.customnameplates.api.feature.bubble.Bubble; import java.util.Optional; // Get a background Optional background = api.getBackground("premium_bg"); if (background.isPresent()) { System.out.println("Found background: " + background.get().id()); } // Get a bubble Optional bubble = api.getBubble("chat_bubble_1"); if (bubble.isPresent()) { System.out.println("Found bubble: " + bubble.get().id()); } ``` -------------------------------- ### Add Custom-Nameplates Maven Repository Source: https://github.com/xiao-momi/custom-nameplates/blob/main/README.md This snippet shows how to add the Custom-Nameplates Maven repository to your project's build configuration. This is necessary to fetch the Custom-Nameplates library. ```kotlin repositories { maven("https://repo.momirealms.net/releases/") } ``` -------------------------------- ### Register Custom Requirement Factory in Java Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Demonstrates how to create and register a custom requirement factory for conditional feature activation. This involves defining a `RequirementFactory` that checks player permissions and registering it with the `RequirementManager`. ```java import net.momirealms.customnameplates.api.requirement.RequirementManager; import net.momirealms.customnameplates.api.requirement.RequirementFactory; import net.momirealms.customnameplates.api.requirement.Requirement; import net.momirealms.customnameplates.api.CNPlayer; CustomNameplates plugin = api.plugin(); RequirementManager requirementManager = plugin.getRequirementManager(); // Create a custom requirement factory RequirementFactory permissionRequirement = (section) -> { String permission = section.getString("permission"); return new Requirement() { @Override public boolean isMet(CNPlayer p1, CNPlayer p2) { return p1.hasPermission(permission); } @Override public String type() { return "custom_permission"; } @Override public boolean equals(Object obj) { if (obj instanceof Requirement other) { return this.type().equals(other.type()); } return false; } @Override public int hashCode() { return type().hashCode(); } }; }; // Register the requirement factory boolean registered = requirementManager.registerRequirement( permissionRequirement, "custom_permission", "has_permission" ); if (registered) { System.out.println("Custom requirement registered successfully"); } // Check if a requirement type exists if (requirementManager.hasRequirement("custom_permission")) { RequirementFactory factory = requirementManager.getRequirementFactory("custom_permission"); System.out.println("Factory found: " + (factory != null)); } ``` -------------------------------- ### Managing Player Nameplates and Bubbles Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Instructions for setting and retrieving player nameplate and chat bubble configurations, including temporary and persistent changes. ```APIDOC ## Managing Player Nameplates and Bubbles ### Description Set and retrieve player nameplate and chat bubble configurations. This includes getting the current nameplate, setting temporary nameplates that are not saved, and setting persistent nameplate and bubble data that can be saved to the database. ### Method Java API Call ### Endpoint N/A ### Parameters N/A ### Request Example ```java import net.momirealms.customnameplates.api.CNPlayer; import net.momirealms.customnameplates.api.CustomNameplatesAPI; import java.util.UUID; // Assume api and playerUUID are already initialized UUID playerUUID = UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5"); CustomNameplatesAPI api = CustomNameplatesAPI.getInstance(); CNPlayer player = api.getPlayer(playerUUID); if (player != null && player.isLoaded()) { // Get current nameplate String currentNameplate = player.currentNameplate(); System.out.println("Current nameplate: " + currentNameplate); // Set temporary nameplate (not saved to database) boolean success = player.setCurrentNameplate("vip_nameplate"); if (success) { System.out.println("Temporary nameplate set"); } // Set and save nameplate data to database success = player.setNameplateData("premium_nameplate"); if (success) { player.save(); // Persist to database System.out.println("Nameplate saved to database"); } // Work with chat bubbles String currentBubble = player.currentBubble(); player.setCurrentBubble("custom_bubble"); player.setBubbleData("custom_bubble"); player.save(); } ``` ### Response N/A ``` -------------------------------- ### Manage Player Nameplates and Chat Bubbles (Java) Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Illustrates how to dynamically set and retrieve player nameplate configurations, including temporary changes and persistent storage. It also covers managing chat bubble display settings for individual players. ```java import net.momirealms.customnameplates.api.CNPlayer; import net.momirealms.customnameplates.api.CustomNameplatesAPI; import java.util.UUID; UUID playerUUID = UUID.fromString("069a79f4-44e9-4726-a5be-fca90e38aaf5"); CustomNameplatesAPI api = CustomNameplatesAPI.getInstance(); CNPlayer player = api.getPlayer(playerUUID); if (player != null && player.isLoaded()) { // Get current nameplate String currentNameplate = player.currentNameplate(); System.out.println("Current nameplate: " + currentNameplate); // Set temporary nameplate (not saved to database) boolean success = player.setCurrentNameplate("vip_nameplate"); if (success) { System.out.println("Temporary nameplate set"); } // Set and save nameplate data to database success = player.setNameplateData("premium_nameplate"); if (success) { player.save(); // Persist to database System.out.println("Nameplate saved to database"); } // Work with chat bubbles String currentBubble = player.currentBubble(); player.setCurrentBubble("custom_bubble"); player.setBubbleData("custom_bubble"); player.save(); } ``` -------------------------------- ### Retrieve Nameplate Configurations and Permissions (Java) Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Access available nameplate configurations and check player permissions using the NameplateManager. This includes retrieving specific nameplates by ID, listing all available nameplates, verifying player access, and identifying the default nameplate. ```java import net.momirealms.customnameplates.api.feature.nameplate.Nameplate; import net.momirealms.customnameplates.api.feature.nameplate.NameplateManager; import java.util.Collection; import java.util.Optional; CustomNameplates plugin = api.plugin(); NameplateManager nameplateManager = plugin.getNameplateManager(); // Get a specific nameplate by ID Optional nameplate = api.getNameplate("epic_nameplate"); if (nameplate.isPresent()) { System.out.println("Found nameplate: " + nameplate.get().id()); } // Get all available nameplates Collection allNameplates = nameplateManager.nameplates(); System.out.println("Total nameplates: " + allNameplates.size()); // Check if player has access to a nameplate CNPlayer player = api.getPlayer(playerUUID); if (player != null) { boolean hasAccess = nameplateManager.hasNameplate(player, "epic_nameplate"); if (hasAccess) { // Get all nameplates available to this player Collection availableNameplates = nameplateManager.availableNameplates(player); System.out.println("Player has access to " + availableNameplates.size() + " nameplates"); } } // Get default nameplate String defaultId = nameplateManager.defaultNameplateId(); System.out.println("Default nameplate: " + defaultId); ``` -------------------------------- ### Measure Text Width and Create Static Positioned Text (Java) Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Calculate the visual width of a given text string and create text elements with static positioning (left, right, or center alignment). This is useful for precise layout control within nameplates. ```java import net.momirealms.customnameplates.api.placeholder.internal.StaticPosition; CustomNameplatesAPI api = CustomNameplatesAPI.getInstance(); // Get the visual width of text String text = "Hello World"; float advance = api.getTextAdvance(text); System.out.println("Text width: " + advance + " pixels"); // Create left-aligned text within a specific width String leftAligned = api.createStaticText(text, 100, StaticPosition.LEFT); // Create right-aligned text String rightAligned = api.createStaticText(text, 100, StaticPosition.RIGHT); // Create center-aligned text String centered = api.createStaticText(text, 100, StaticPosition.MIDDLE); // The plugin automatically adds offset characters to position the text System.out.println("Left aligned: " + leftAligned); System.out.println("Right aligned: " + rightAligned); System.out.println("Centered: " + centered); ``` -------------------------------- ### Include Custom-Nameplates Dependency Source: https://github.com/xiao-momi/custom-nameplates/blob/main/README.md This snippet demonstrates how to include the Custom-Nameplates library as a compile-only dependency in your project. This allows you to use the library's features without it being bundled into your final artifact. ```kotlin dependencies { compileOnly("net.momirealms:custom-nameplates:3.0.19") } ``` -------------------------------- ### Load and Access Configuration Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Utilize the ConfigManager to load and access YAML configuration files for the Custom Nameplates plugin. This allows for easy retrieval of settings like debug mode, module status, and namespaced values. ```java import net.momirealms.customnameplates.api.ConfigManager; import dev.dejvokep.boostedyaml.YamlDocument; // Get the main configuration YamlDocument config = ConfigManager.getMainConfig(); // Access configuration values boolean debugMode = ConfigManager.debug(); boolean nameplateModule = ConfigManager.nameplateModule(); boolean actionbarModule = ConfigManager.actionbarModule(); String namespace = ConfigManager.namespace(); String font = ConfigManager.font(); System.out.println("Debug mode: " + debugMode); System.out.println("Namespace: " + namespace); System.out.println("Font: " + font); // Get specific values from config String forceLocale = config.getString("force-locale", "en_US"); int refreshInterval = ConfigManager.defaultPlaceholderRefreshInterval(); boolean legacySupport = config.getBoolean("other-settings.legacy-color-code-support", true); System.out.println("Locale: " + forceLocale); System.out.println("Default refresh interval: " + refreshInterval + " ticks"); // Check module status if (ConfigManager.bubbleModule()) { System.out.println("Bubble module is enabled"); } if (ConfigManager.bossbarModule()) { System.out.println("Boss bar module is enabled"); } ``` -------------------------------- ### Add Custom Nameplates Dependency (Gradle Kotlin) Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Integrates the Custom Nameplates plugin into your Gradle project by adding its Maven repository and dependency. This allows your project to utilize the plugin's API. ```kotlin repositories { maven("https://repo.momirealms.net/releases/") } dependencies { compileOnly("net.momirealms:custom-nameplates:3.0.19") } ``` -------------------------------- ### Register Custom Placeholders with CustomNameplates API Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Demonstrates how to register shared, player-specific, and relational placeholders using the CustomNameplates API. It specifies custom refresh intervals and provides lambda functions for generating placeholder values based on server state, player data, or relational information. Dependencies include the CustomNameplates API library. ```java import net.momirealms.customnameplates.api.placeholder.PlaceholderManager; import net.momirealms.customnameplates.api.placeholder.SharedPlaceholder; import net.momirealms.customnameplates.api.placeholder.PlayerPlaceholder; import net.momirealms.customnameplates.api.placeholder.RelationalPlaceholder; import net.momirealms.customnameplates.api.CNPlayer; CustomNameplates plugin = api.plugin(); PlaceholderManager placeholderManager = plugin.getPlaceholderManager(); // Register a shared placeholder (same for all players) SharedPlaceholder serverPlaceholder = placeholderManager.registerSharedPlaceholder( "%server_time%", 20, // Refresh every 20 ticks (1 second) () -> { return String.valueOf(System.currentTimeMillis()); } ); // Register a player-specific placeholder PlayerPlaceholder healthPlaceholder = placeholderManager.registerPlayerPlaceholder( "%player_health%", 10, // Refresh every 10 ticks (player) -> { // Get player's health from underlying player object Object bukkitPlayer = player.player(); if (bukkitPlayer instanceof org.bukkit.entity.Player) { return String.valueOf(((org.bukkit.entity.Player) bukkitPlayer).getHealth()); } return "0"; } ); // Register a relational placeholder (between two players) RelationalPlaceholder distancePlaceholder = placeholderManager.registerRelationalPlaceholder( "%player_distance%", 20, // Refresh every 20 ticks (player1, player2) -> { Vector3 pos1 = player1.position(); Vector3 pos2 = player2.position(); double distance = Math.sqrt( Math.pow(pos1.x() - pos2.x(), 2) + Math.pow(pos1.y() - pos2.y(), 2) + Math.pow(pos1.z() - pos2.z(), 2) ); return String.format("%.1f", distance); } ); System.out.println("Registered 3 custom placeholders"); ``` -------------------------------- ### Create Text with Embedded Images (Java) Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Generate formatted text strings that include embedded images with specified margins. This feature allows for visually rich nameplates by combining text elements with custom graphical assets. ```java import net.momirealms.customnameplates.api.feature.AdaptiveImage; import net.momirealms.customnameplates.api.CustomNameplatesAPI; CustomNameplatesAPI api = CustomNameplatesAPI.getInstance(); // Assume you have an AdaptiveImage instance (typically retrieved from configuration) AdaptiveImage image = getCustomImage(); // Implementation specific // Create text with image, applying left and right margins String text = "Player Name"; float leftMargin = 2.0f; float rightMargin = 2.0f; String formattedText = api.createTextWithImage(text, image, leftMargin, rightMargin); // The result includes proper image positioning and margins around the text System.out.println("Formatted text: " + formattedText); ``` -------------------------------- ### Manage ActionBar Control Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Control the display of the action bar to prevent conflicts with other plugins. The CNPlayer API allows plugins to acquire and release the action bar for custom display purposes. ```java import net.momirealms.customnameplates.api.CNPlayer; CNPlayer player = api.getPlayer(playerUUID); if (player != null) { // Acquire the action bar (prevent CustomNameplates from controlling it) player.acquireActionBar("my_plugin_feature"); System.out.println("Action bar acquired for custom use"); // Display custom action bar content through your own methods // ... // Release the action bar (allow CustomNameplates to control it again) player.releaseActionBar("my_plugin_feature"); // Check if CustomNameplates should control the action bar if (player.shouldCNTakeOverActionBar()) { System.out.println("CustomNameplates can now control the action bar"); } } ``` -------------------------------- ### Listen to Custom Nameplates Plugin Events Source: https://context7.com/xiao-momi/custom-nameplates/llms.txt Subscribe to events such as data loading and plugin reloading to react to changes within the Custom Nameplates plugin. This allows for dynamic updates and custom logic based on plugin states. ```java import net.momirealms.customnameplates.api.event.DataLoadEvent; import net.momirealms.customnameplates.api.event.NameplatesReloadEvent; import net.momirealms.customnameplates.common.event.EventManager; import net.momirealms.customnameplates.api.storage.data.PlayerData; CustomNameplates plugin = api.plugin(); EventManager eventManager = plugin.getEventManager(); // Register a data load event listener eventManager.registerListener(DataLoadEvent.class, (event) -> { PlayerData data = event.data(); System.out.println("Player data loaded for: " + data.uuid()); System.out.println("Nameplate: " + data.nameplate()); System.out.println("Bubble: " + data.bubble()); // Modify data if needed if (data.nameplate() == null) { data.setNameplate("default_nameplate"); System.out.println("Set default nameplate"); } }); // Register a reload event listener eventManager.registerListener(NameplatesReloadEvent.class, (event) -> { System.out.println("CustomNameplates plugin has been reloaded"); // Refresh custom placeholders or requirements placeholderManager.refreshPlaceholders(); }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.