### InventorySource Creation Methods Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/inventory/class-use/InventorySource.html Provides examples of static methods for creating various InventorySource instances. ```APIDOC ## InventorySource Factory Methods ### Description These static methods allow for the creation of different types of InventorySource objects. ### Method - `fromContainerWindowId(int containerId)` - `fromCreativeInventory()` - `fromGlobalInventory()` - `fromInvalid()` - `fromNonImplementedTodo(int containerId)` - `fromUntrackedInteractionUI(int containerId)` - `fromWorldInteraction(InventorySource.Flag flag)` ### Endpoint N/A (Static methods within InventorySource class) ### Parameters #### fromContainerWindowId - **containerId** (int) - Required - The ID of the container window. #### fromNonImplementedTodo - **containerId** (int) - Required - The ID of the container window for a non-implemented todo. #### fromUntrackedInteractionUI - **containerId** (int) - Required - The ID of the container window for untracked UI interaction. #### fromWorldInteraction - **flag** (InventorySource.Flag) - Required - A flag indicating the type of world interaction. ### Request Example ```java // Example usage of factory methods InventorySource containerSource = InventorySource.fromContainerWindowId(10); InventorySource creativeSource = InventorySource.fromCreativeInventory(); InventorySource worldSource = InventorySource.fromWorldInteraction(InventorySource.Flag.SOME_FLAG); ``` ### Response #### Success Response (200) - Each method returns an `InventorySource` object representing the specified type. #### Response Example ```json // Conceptual representation of an InventorySource object { "type": "ContainerWindowId", "containerId": 10 } ``` ``` -------------------------------- ### Handle StartGamePacket in BedrockPacketHandler (Java) Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/class-use/StartGamePacket.html Demonstrates the implementation of the handle method in BedrockPacketHandler to process a StartGamePacket. This method is part of the interface for handling incoming packets, allowing custom logic for game start events. ```java package com.nukkitx.protocol.bedrock.handler; import com.nukkitx.protocol.bedrock.packet.StartGamePacket; public interface BedrockPacketHandler { boolean handle(StartGamePacket packet); } ``` -------------------------------- ### Initialize BedrockServer Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/BedrockServer.html Demonstrates how to instantiate a BedrockServer with a specific bind address and thread configuration. ```java InetSocketAddress address = new InetSocketAddress("0.0.0.0", 19132); BedrockServer server = new BedrockServer(address, 4); ``` -------------------------------- ### StructureBlockType Static Methods Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/structure/StructureBlockType.html Provides static methods for the StructureBlockType enum: `from(int id)` to get a type by its integer ID, `valueOf(String name)` to get a type by its name, and `values()` to get an array of all enum constants. ```java public static StructureBlockType from(int id) public static StructureBlockType valueOf(String name) public static StructureBlockType[] values() ``` -------------------------------- ### Initialize SerializedSkin Builder Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/skin/class-use/SerializedSkin.Builder.html Demonstrates how to instantiate a new SerializedSkin.Builder instance to begin configuring skin properties. ```java SerializedSkin.Builder builder = SerializedSkin.builder(); ``` -------------------------------- ### Method Summary for PacketViolationType Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/PacketViolationType.html Details the static methods available for the PacketViolationType enum, specifically valueOf() to get an enum constant by name and values() to get all constants. ```java static PacketViolationType valueOf(String name) static PacketViolationType[] values() ``` -------------------------------- ### GET /toString Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/util/OptionalBoolean.html Returns a string representation of the object. ```APIDOC ## GET /toString ### Description Returns a non-empty string representation of this object suitable for debugging. ### Method GET ### Endpoint /toString ### Response #### Success Response (200) - **representation** (String) - The string representation of the instance. ``` -------------------------------- ### AdventureSettingsPacket Constructor Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/AdventureSettingsPacket.html Initializes a new instance of the AdventureSettingsPacket class. This constructor does not take any arguments. ```java public AdventureSettingsPacket() { } ``` -------------------------------- ### GET /packets/available-commands Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/index-all.html Retrieves the list of available commands for the client. ```APIDOC ## GET /packets/available-commands ### Description Fetches the AvailableCommandsPacket which defines the command structure available to the client. ### Method GET ### Endpoint /packets/available-commands ### Parameters None ### Response #### Success Response (200) - **packet** (AvailableCommandsPacket) - The packet containing command definitions. #### Response Example { "packet_type": "AvailableCommandsPacket" } ``` -------------------------------- ### Initialize StartGamePacket.ItemEntry Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/StartGamePacket.ItemEntry.html Demonstrates how to instantiate the ItemEntry class using its constructor, which requires a string identifier and a short integer ID. ```java import com.nukkitx.protocol.bedrock.packet.StartGamePacket; // Creating a new ItemEntry instance StartGamePacket.ItemEntry entry = new StartGamePacket.ItemEntry("minecraft:apple", (short) 260); ``` -------------------------------- ### StartGamePacket Class Definition Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/StartGamePacket.html Defines the StartGamePacket class, extending BedrockPacket. It includes nested classes, constructors, and methods for handling game start packet data. ```java public class StartGamePacket extends BedrockPacket { public class ItemEntry public StartGamePacket() public final boolean handle(BedrockPacketHandler handler) public BedrockPacketType getPacketType() } ``` -------------------------------- ### GET /equals Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/util/OptionalBoolean.html Indicates whether some other object is equal to this OptionalBoolean. ```APIDOC ## GET /equals ### Description Indicates whether some other object is equal to this OptionalBoolean based on value presence and equality. ### Method GET ### Endpoint /equals ### Parameters #### Query Parameters - **obj** (Object) - Required - The object to be tested for equality. ### Response #### Success Response (200) - **result** (boolean) - Returns true if the other object is equal to this object, otherwise false. ``` -------------------------------- ### POST /handle/SpawnExperienceOrbPacket Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/class-use/SpawnExperienceOrbPacket.html Handles the SpawnExperienceOrbPacket within the Bedrock protocol handler to process experience orb spawning events. ```APIDOC ## POST /handle/SpawnExperienceOrbPacket ### Description Processes the SpawnExperienceOrbPacket to manage the spawning of experience orbs in the game world. ### Method POST ### Endpoint /com.nukkitx.protocol.bedrock.handler/handle ### Parameters #### Request Body - **packet** (SpawnExperienceOrbPacket) - Required - The packet object containing experience orb spawn data. ### Request Example { "packet": { "runtimeEntityId": 12345, "x": 10.5, "y": 64.0, "z": 10.5, "amount": 1 } } ### Response #### Success Response (200) - **result** (boolean) - Returns true if the packet was handled successfully. #### Response Example { "result": true } ``` -------------------------------- ### GET /EntityInteractEventData/type Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/event/EntityInteractEventData.html Retrieves the event type for the EntityInteractEventData object. ```APIDOC ## GET /EntityInteractEventData/type ### Description Retrieves the specific EventDataType associated with the EntityInteractEventData instance. ### Method GET ### Endpoint /EntityInteractEventData/type ### Parameters None ### Request Example N/A (Object method call) ### Response #### Success Response (200) - **type** (EventDataType) - The type of the event. #### Response Example { "type": "ENTITY_INTERACT" } ``` -------------------------------- ### SpawnExperienceOrbPacket Class Reference Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/SpawnExperienceOrbPacket.html Details the structure and methods for the SpawnExperienceOrbPacket class used in the Bedrock protocol. ```APIDOC ## SpawnExperienceOrbPacket ### Description Represents a packet sent to spawn an experience orb entity within the Minecraft Bedrock environment. ### Class Hierarchy - java.lang.Object - com.nukkitx.protocol.bedrock.BedrockPacket - com.nukkitx.protocol.bedrock.packet.SpawnExperienceOrbPacket ### Constructor - **SpawnExperienceOrbPacket()** - Initializes a new instance of the packet. ### Methods - **getPacketType()** (BedrockPacketType) - Returns the packet type identifier. - **handle(BedrockPacketHandler handler)** (boolean) - Dispatches the packet to the provided handler. ### Request Example ```java SpawnExperienceOrbPacket packet = new SpawnExperienceOrbPacket(); ``` ``` -------------------------------- ### Connect to Bedrock Server Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/BedrockClient.html Shows how to initiate a connection to a remote Bedrock server using the connect method, which returns a CompletableFuture for asynchronous handling. ```java CompletableFuture future = client.connect(new InetSocketAddress("example.com", 19132)); future.thenAccept(session -> { System.out.println("Connected to server!"); }); ``` -------------------------------- ### GET /bedrock/session Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/class-use/BedrockClientSession.html Retrieves the current active BedrockClient session. ```APIDOC ## GET /bedrock/session ### Description Retrieves the active session associated with the BedrockClient instance. ### Method GET ### Endpoint /bedrock/session ### Response #### Success Response (200) - **session** (BedrockClientSession) - The active client session object. #### Response Example { "session": "[BedrockClientSession Object]" } ``` -------------------------------- ### Initialize BedrockClient Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/BedrockClient.html Demonstrates the various constructors available for initializing a BedrockClient instance with specific bind addresses and Netty EventLoopGroups. ```java BedrockClient client = new BedrockClient(new InetSocketAddress("0.0.0.0", 19132)); BedrockClient clientWithGroup = new BedrockClient(new InetSocketAddress("0.0.0.0", 19132), eventLoopGroup); BedrockClient clientWithFullGroups = new BedrockClient(new InetSocketAddress("0.0.0.0", 19132), bossGroup, workerGroup); ``` -------------------------------- ### GET /hashCode Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/util/OptionalBoolean.html Returns the hash code value of the present value. ```APIDOC ## GET /hashCode ### Description Returns the hash code value of the present value, or 0 if no value is present. ### Method GET ### Endpoint /hashCode ### Response #### Success Response (200) - **hashCode** (int) - The hash code value. ``` -------------------------------- ### GET /protocol/events/type Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/event/class-use/EventDataType.html Retrieves the EventDataType for a specific event data object. ```APIDOC ## GET /protocol/events/type ### Description Returns the EventDataType associated with a specific event data implementation (e.g., MobKilledEventData, PlayerDiedEventData). ### Method GET ### Endpoint /protocol/events/type ### Parameters #### Query Parameters - **event_class** (string) - Required - The specific event data class name (e.g., 'MobKilledEventData') ### Request Example { "event_class": "MobKilledEventData" } ### Response #### Success Response (200) - **type** (string) - The identifier for the EventDataType #### Response Example { "type": "MOB_KILLED" } ``` -------------------------------- ### ShowStoreOfferPacket Handling Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/class-use/ShowStoreOfferPacket.html Demonstrates how the BedrockPacketHandler handles the ShowStoreOfferPacket. ```APIDOC ## BedrockPacketHandler.handle(ShowStoreOfferPacket) ### Description This method is part of the BedrockPacketHandler interface and is used to handle incoming ShowStoreOfferPacket instances. ### Method `default boolean` ### Endpoint N/A (Method within an interface) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **packet** (ShowStoreOfferPacket) - Required - The ShowStoreOfferPacket to be handled. ### Request Example ```json { "packet": { ... ShowStoreOfferPacket details ... } } ``` ### Response #### Success Response (200) - **boolean** (boolean) - Indicates if the packet was successfully handled. #### Response Example ```json { "handled": true } ``` ``` -------------------------------- ### GET /event/code-builder/type Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/event/CodeBuilderActionEventData.html Retrieves the event type associated with the CodeBuilderActionEventData object. ```APIDOC ## GET /event/code-builder/type ### Description Retrieves the specific EventDataType for a CodeBuilderActionEventData instance. ### Method GET ### Endpoint /event/code-builder/type ### Parameters None ### Request Example GET /event/code-builder/type ### Response #### Success Response (200) - **type** (EventDataType) - The type of the code builder event. #### Response Example { "type": "CODE_BUILDER_ACTION" } ``` -------------------------------- ### GET /event/cauldron-interact Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/event/CauldronInteractEventData.html Retrieves the event type for a cauldron interaction event. ```APIDOC ## GET /event/cauldron-interact ### Description Retrieves the EventDataType associated with the CauldronInteractEventData object. ### Method GET ### Endpoint /event/cauldron-interact ### Parameters None ### Request Example {} ### Response #### Success Response (200) - **type** (EventDataType) - The type of the event, specifically identifying it as a Cauldron interaction. #### Response Example { "type": "CAULDRON_INTERACT" } ``` -------------------------------- ### BedrockCompat Constructor Detail Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/compat/BedrockCompat.html Detailed information about the BedrockCompat constructor. ```APIDOC ## Constructor Detail: BedrockCompat ### Constructor `public BedrockCompat()` ### Description Initializes a new instance of the BedrockCompat class. ``` -------------------------------- ### GET /packets/available-entity-identifiers Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/index-all.html Retrieves the list of entity identifiers available in the current session. ```APIDOC ## GET /packets/available-entity-identifiers ### Description Fetches the AvailableEntityIdentifiersPacket which provides the client with a list of all valid entity identifiers. ### Method GET ### Endpoint /packets/available-entity-identifiers ### Parameters None ### Response #### Success Response (200) - **packet** (AvailableEntityIdentifiersPacket) - The packet containing entity identifiers. #### Response Example { "packet_type": "AvailableEntityIdentifiersPacket" } ``` -------------------------------- ### Constructor: BedrockPacketDefinition Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/BedrockPacketDefinition.html Initializes a new instance of the BedrockPacketDefinition class. ```APIDOC ## Constructor: BedrockPacketDefinition ### Description Creates a new definition instance for a Bedrock packet. ### Method Constructor ### Endpoint com.nukkitx.protocol.bedrock.BedrockPacketDefinition ### Parameters None ### Request Example new BedrockPacketDefinition(); ### Response #### Success Response (200) - **instance** (Object) - A new instance of BedrockPacketDefinition. ``` -------------------------------- ### com.nukkitx.protocol.bedrock.data.structure Package Overview Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/structure/package-use.html Overview of the classes within the com.nukkitx.protocol.bedrock.data.structure package and their relationships. ```APIDOC ## Package: com.nukkitx.protocol.bedrock.data.structure ### Description This package contains data structures related to structures in the Bedrock protocol. ### Classes in this package used by other packages: - **StructureSettings**: Used by com.nukkitx.protocol.bedrock and com.nukkitx.protocol.bedrock.compat. - **StructureAnimationMode**: Used by com.nukkitx.protocol.bedrock.data.structure. - **StructureBlockType**: Used by com.nukkitx.protocol.bedrock.data.structure. - **StructureMirror**: Used by com.nukkitx.protocol.bedrock.data.structure. - **StructureRedstoneSaveMode**: Used by com.nukkitx.protocol.bedrock.data.structure. - **StructureRotation**: Used by com.nukkitx.protocol.bedrock.data.structure. - **StructureTemplateRequestOperation**: Used by com.nukkitx.protocol.bedrock.data.structure. - **StructureTemplateResponseType**: Used by com.nukkitx.protocol.bedrock.data.structure. ### Classes within this package: - StructureAnimationMode - StructureBlockType - StructureMirror - StructureRedstoneSaveMode - StructureRotation - StructureSettings - StructureTemplateRequestOperation - StructureTemplateResponseType ``` -------------------------------- ### Get Packet Type Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/SubClientLoginPacket.html Retrieves the specific BedrockPacketType associated with the SubClientLoginPacket instance. ```java public BedrockPacketType getPacketType() { return BedrockPacketType.SUB_CLIENT_LOGIN; } ``` -------------------------------- ### Initialize Int2ObjectBiMap Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/util/Int2ObjectBiMap.html Demonstrates the various constructor options available for initializing an Int2ObjectBiMap, including capacity, load factor, and no-entry defaults. ```java Int2ObjectBiMap map = new Int2ObjectBiMap<>(); Int2ObjectBiMap mapWithCapacity = new Int2ObjectBiMap<>(16); Int2ObjectBiMap fullConfigMap = new Int2ObjectBiMap<>(16, 0.75f, -1, "default"); ``` -------------------------------- ### GET /api/events/cauldron-used Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/event/CauldronUsedEventData.html Retrieves the event type data for a cauldron usage event. ```APIDOC ## GET /api/events/cauldron-used ### Description Retrieves the specific EventDataType for the CauldronUsedEventData object. ### Method GET ### Endpoint /api/events/cauldron-used ### Parameters None ### Request Example {} ### Response #### Success Response (200) - **type** (EventDataType) - The type identifier for the cauldron used event. #### Response Example { "type": "CAULDRON_USED" } ``` -------------------------------- ### Handle SpawnExperienceOrbPacket in Java Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/handler/BedrockPacketHandler.html Manages the SpawnExperienceOrbPacket, returning a boolean to confirm successful handling. This is a default handler for this packet. ```java default boolean handle(SpawnExperienceOrbPacket packet) ``` -------------------------------- ### GET /game/publish-setting/byId Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/GamePublishSetting.html Retrieves a GamePublishSetting enum constant based on its integer ID. ```APIDOC ## GET /game/publish-setting/byId ### Description Retrieves the GamePublishSetting enum constant that corresponds to the provided integer identifier. ### Method GET ### Endpoint /game/publish-setting/byId ### Parameters #### Query Parameters - **id** (int) - Required - The integer ID representing the specific game publish setting. ### Request Example GET /game/publish-setting/byId?id=0 ### Response #### Success Response (200) - **setting** (string) - The name of the GamePublishSetting (e.g., "PUBLIC", "NO_MULTI_PLAY"). #### Response Example { "setting": "PUBLIC" } ``` -------------------------------- ### POST /connect Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/BedrockClient.html Establishes a connection to a remote Bedrock server address. ```APIDOC ## POST /connect ### Description Initiates a connection to a specified Bedrock server address, returning a CompletableFuture that resolves to a BedrockClientSession. ### Method POST ### Endpoint /connect ### Parameters #### Request Body - **address** (InetSocketAddress) - Required - The target server address. - **timeout** (long) - Optional - Connection timeout duration. - **unit** (TimeUnit) - Optional - Time unit for the timeout. ### Request Example { "address": "127.0.0.1:19132", "timeout": 5000, "unit": "MILLISECONDS" } ### Response #### Success Response (200) - **session** (BedrockClientSession) - The established client session. #### Response Example { "status": "connected", "session_id": "uuid-1234-5678" } ``` -------------------------------- ### GET /enum/values Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/index-all.html Retrieves an array of all constants defined in a specific protocol enum type. ```APIDOC ## GET /enum/values ### Description Returns an array containing the constants of the specified enum type, in the order they are declared. This is a standard static method pattern used across the NukkitX Bedrock protocol data structures. ### Method GET ### Endpoint /enum/values?type={enum_name} ### Parameters #### Query Parameters - **type** (string) - Required - The fully qualified name of the enum (e.g., com.nukkitx.protocol.bedrock.data.TransactionType) ### Request Example GET /enum/values?type=com.nukkitx.protocol.bedrock.data.TransactionType ### Response #### Success Response (200) - **values** (array) - An array of strings representing the enum constants. #### Response Example ["NORMAL", "MISC", "CLIENT_USE", "CLIENT_REQUEST_ACTION"] ``` -------------------------------- ### GET /protocol/enums/AuthoritativeMovementMode Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/package-summary.html Details the AuthoritativeMovementMode enum used in the StartGamePacket to verify client movement. ```APIDOC ## GET /protocol/enums/AuthoritativeMovementMode ### Description Retrieves the definition of the AuthoritativeMovementMode enum, which dictates how the server validates client movement. ### Method GET ### Endpoint /protocol/enums/AuthoritativeMovementMode ### Response #### Success Response (200) - **description** (string) - The authoritative movement mode chosen by the server in the StartGamePacket to verify the clients movement is valid. #### Response Example { "enum": "AuthoritativeMovementMode", "description": "The authoritative movement mode chosen by the server in the StartGamePacket to verify the clients movement is valid." } ``` -------------------------------- ### PlayerFogPacket Usage Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/class-use/PlayerFogPacket.html Demonstrates how the PlayerFogPacket is handled by the BedrockPacketHandler. ```APIDOC ## Handling PlayerFogPacket ### Description This section describes how the `PlayerFogPacket` is utilized within the `com.nukkitx.protocol.bedrock.handler` package, specifically by the `BedrockPacketHandler`. ### Method `default boolean handle(PlayerFogPacket packet)` ### Endpoint N/A (This is a Java method signature, not a REST endpoint) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body for this method signature." } ``` ### Response #### Success Response (200) - **boolean** - Indicates if the packet was handled successfully. #### Response Example ```json { "example": "true or false" } ``` ``` -------------------------------- ### InventorySource Reading and Writing Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/inventory/class-use/InventorySource.html Demonstrates how to read and write InventorySource objects using BedrockPacketHelper. ```APIDOC ## BedrockPacketHelper InventorySource Operations ### Description This section details methods for reading and writing InventorySource objects to and from a ByteBuf. ### Method - `readSource(ByteBuf buffer)` - `writeSource(ByteBuf buffer, InventorySource inventorySource)` ### Endpoint N/A (Internal helper methods) ### Parameters #### readSource - **buffer** (ByteBuf) - Required - The buffer to read the InventorySource from. #### writeSource - **buffer** (ByteBuf) - Required - The buffer to write the InventorySource to. - **inventorySource** (InventorySource) - Required - The InventorySource object to write. ### Request Example ```json // Reading an InventorySource InventorySource source = BedrockPacketHelper.readSource(byteBuf); // Writing an InventorySource BedrockPacketHelper.writeSource(byteBuf, inventorySource); ``` ### Response #### Success Response (200) - `readSource`: Returns an InventorySource object. - `writeSource`: void (writes to buffer). #### Response Example ```json // Example of a read InventorySource object structure (conceptual) { "type": "InventorySourceType", "data": "..." } ``` ``` -------------------------------- ### GET /crafting-data/type Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/inventory/CraftingDataType.html Retrieves a specific crafting type constant based on its integer identifier. ```APIDOC ## GET /crafting-data/type ### Description Retrieves the CraftingDataType enum constant associated with the provided integer ID. ### Method GET ### Endpoint /crafting-data/type ### Parameters #### Query Parameters - **id** (integer) - Required - The unique identifier for the crafting type. ### Request Example GET /crafting-data/type?id=1 ### Response #### Success Response (200) - **type** (string) - The name of the CraftingDataType constant (e.g., "SHAPED"). #### Response Example { "type": "SHAPED" } ``` -------------------------------- ### Instantiate ImageData from various sources Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/skin/class-use/ImageData.html Demonstrates how to create an ImageData instance using static factory methods. These methods accept raw byte arrays, dimensions, or Java BufferedImages. ```java ImageData empty = ImageData.EMPTY; ImageData fromImage = ImageData.from(bufferedImage); ImageData fromBytes = ImageData.of(byteArray); ImageData fromDimensions = ImageData.of(width, height, byteArray); ``` -------------------------------- ### GET /EntityDamageCause/from Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/entity/EntityDamageCause.html Retrieves an EntityDamageCause enum constant based on the provided integer ID. ```APIDOC ## GET /EntityDamageCause/from ### Description Retrieves the enum constant associated with the specified integer ID. ### Method GET ### Endpoint /EntityDamageCause/from ### Parameters #### Query Parameters - **id** (int) - Required - The unique integer identifier for the damage cause. ### Request Example GET /EntityDamageCause/from?id=1 ### Response #### Success Response (200) - **EntityDamageCause** (enum) - The corresponding enum constant. #### Response Example { "cause": "ENTITY_ATTACK" } ### Errors - **IllegalArgumentException**: Thrown if no constant exists for the provided ID. - **NullPointerException**: Thrown if the input argument is null. ``` -------------------------------- ### GET /structure/redstone-save-mode/{id} Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/structure/StructureRedstoneSaveMode.html Retrieves the StructureRedstoneSaveMode enum constant based on the provided integer ID. ```APIDOC ## GET /structure/redstone-save-mode/{id} ### Description Retrieves the corresponding StructureRedstoneSaveMode enum constant for a given integer identifier. ### Method GET ### Endpoint /structure/redstone-save-mode/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier for the redstone save mode. ### Request Example GET /structure/redstone-save-mode/0 ### Response #### Success Response (200) - **mode** (string) - The name of the enum constant (e.g., "SAVES_TO_MEMORY" or "SAVES_TO_DISK"). #### Response Example { "mode": "SAVES_TO_MEMORY" } ``` -------------------------------- ### Create RecipeIngredient Instance Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/inventory/RecipeIngredient.html Demonstrates how to instantiate a RecipeIngredient using the static factory method. It requires the item ID, auxiliary value, and stack size as integer parameters. ```java RecipeIngredient ingredient = RecipeIngredient.of(1, 0, 64); ``` -------------------------------- ### GET /StackRequestActionData/getType Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/inventory/stackrequestactions/StackRequestActionData.html Retrieves the StackRequestActionType associated with the current stack request action data instance. ```APIDOC ## GET /StackRequestActionData/getType ### Description Retrieves the type of the stack request action. This method is used to identify the specific action being performed in the stack request sequence. ### Method GET ### Endpoint /StackRequestActionData/getType ### Parameters None ### Request Example N/A (Interface method call) ### Response #### Success Response (200) - **type** (StackRequestActionType) - The action type associated with the data. #### Response Example { "type": "CRAFT_RECIPE" } ``` -------------------------------- ### POST /handle/MobEquipmentPacket Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/class-use/MobEquipmentPacket.html Handles the incoming MobEquipmentPacket within the Bedrock protocol handler. ```APIDOC ## POST /handle/MobEquipmentPacket ### Description Processes a MobEquipmentPacket received from a Bedrock client. This method is part of the BedrockPacketHandler interface. ### Method POST ### Endpoint /handle/MobEquipmentPacket ### Parameters #### Request Body - **packet** (MobEquipmentPacket) - Required - The packet object containing equipment data to be processed. ### Request Example { "packet": { "runtimeEntityId": 12345, "inventorySlot": 0, "hotbarSlot": 0, "item": { "id": 276, "count": 1 } } } ### Response #### Success Response (200) - **result** (boolean) - Returns true if the packet was handled successfully. #### Response Example { "result": true } ``` -------------------------------- ### GET /recipe/network-id Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/inventory/stackrequestactions/RecipeStackRequestActionData.html Retrieves the network ID of the recipe associated with the current stack request action. ```APIDOC ## GET /recipe/network-id ### Description Retrieves the network ID of the recipe that the client is currently attempting to craft. ### Method GET ### Endpoint /recipe/network-id ### Parameters None ### Request Example N/A ### Response #### Success Response (200) - **recipeNetworkId** (int) - The unique network ID of the recipe. #### Response Example { "recipeNetworkId": 1024 } ``` -------------------------------- ### BedrockPacketHandler Interface Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/class-use/StartGamePacket.html This section describes the BedrockPacketHandler interface and its methods, specifically focusing on how StartGamePacket is handled. ```APIDOC ## Interface BedrockPacketHandler ### Description Represents a handler for Bedrock protocol packets. This interface defines methods for processing various packet types. ### Package com.nukkitx.protocol.bedrock.handler ## Method handle(StartGamePacket packet) ### Description Handles a StartGamePacket. This is a default method provided by the BedrockPacketHandler interface. ### Method Signature `default boolean handle(StartGamePacket packet)` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **boolean** - Returns true if the packet was handled successfully, false otherwise. #### Response Example None ``` -------------------------------- ### Initialize CommandOutputMessage in Java Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/command/CommandOutputMessage.html Demonstrates the instantiation of the CommandOutputMessage class. This class is used to represent messages returned by command executions in the Bedrock protocol. ```java import com.nukkitx.protocol.bedrock.data.command.CommandOutputMessage; public class Example { public void createMessage() { CommandOutputMessage message = new CommandOutputMessage(); } } ``` -------------------------------- ### GET /inventory/actions/craft-non-implemented Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/inventory/stackrequestactions/CraftNonImplementedStackRequestActionData.html Retrieves information about the CraftNonImplementedStackRequestActionData class used for handling unimplemented inventory actions. ```APIDOC ## GET /inventory/actions/craft-non-implemented ### Description Represents an action sent for inventory operations that are not yet implemented in the system, such as anvil usage. ### Method GET ### Endpoint /inventory/actions/craft-non-implemented ### Parameters None ### Request Example N/A ### Response #### Success Response (200) - **type** (StackRequestActionType) - The type of the stack request action. #### Response Example { "type": "CRAFT_NON_IMPLEMENTED" } ``` -------------------------------- ### GET /classes/CraftLoomStackRequestActionData Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/inventory/stackrequestactions/CraftLoomStackRequestActionData.html Retrieves information about the CraftLoomStackRequestActionData class, including its constructor and type retrieval methods. ```APIDOC ## GET /classes/CraftLoomStackRequestActionData ### Description Provides details on the CraftLoomStackRequestActionData class, which implements StackRequestActionData for loom-related inventory operations. ### Method GET ### Endpoint /classes/CraftLoomStackRequestActionData ### Parameters None ### Request Example N/A ### Response #### Success Response (200) - **getType** (StackRequestActionType) - Returns the action type associated with the loom stack request. #### Response Example { "class": "CraftLoomStackRequestActionData", "implements": "StackRequestActionData", "methods": [ { "name": "getType", "returnType": "StackRequestActionType" } ] } ``` -------------------------------- ### Initialize InventoryActionData Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/inventory/InventoryActionData.html Demonstrates the constructor for creating an instance of InventoryActionData. It requires an InventorySource, slot index, and the source and destination ItemData objects. ```java public InventoryActionData(InventorySource source, int slot, ItemData fromItem, ItemData toItem) ``` -------------------------------- ### PlayerPermission Enum Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/class-use/PlayerPermission.html Details on how to use the PlayerPermission enum, including methods to get enum constants. ```APIDOC ## PlayerPermission Enum ### Description This enum represents player permissions within the NukkitX protocol. ### Methods #### `static PlayerPermission valueOf(String name)` Returns the enum constant of this type with the specified name. #### `static PlayerPermission[] values()` Returns an array containing the constants of this enum type, in the order they are declared. ``` -------------------------------- ### Construct SerializedSkin via Static Factory Methods Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/skin/class-use/SerializedSkin.html Shows how to create a new SerializedSkin instance using the various static 'of' factory methods provided by the SerializedSkin class. ```java import com.nukkitx.protocol.bedrock.data.skin.SerializedSkin; // Creating a basic SerializedSkin instance SerializedSkin skin = SerializedSkin.of( "skinId", "playFabId", skinData, capeData, "geometryName", "geometryData", false ); ``` -------------------------------- ### Example Usage of SetSpawnPositionPacket.Type.values() Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/SetSpawnPositionPacket.Type.html Demonstrates how to iterate over all constants of the SetSpawnPositionPacket.Type enum using the values() method. ```java for (SetSpawnPositionPacket.Type c : SetSpawnPositionPacket.Type.values()) System.out.println(c); ``` -------------------------------- ### POST /bedrock/connect Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/class-use/BedrockClientSession.html Establishes a new connection to a specified address, returning a future that resolves to a BedrockClientSession. ```APIDOC ## POST /bedrock/connect ### Description Initiates a connection to the provided InetSocketAddress. Returns a CompletableFuture that resolves to the established BedrockClientSession. ### Method POST ### Endpoint /bedrock/connect ### Parameters #### Request Body - **address** (InetSocketAddress) - Required - The target server address. - **timeout** (long) - Optional - Connection timeout duration. - **unit** (TimeUnit) - Optional - Time unit for the timeout. ### Request Example { "address": "127.0.0.1:19132", "timeout": 30, "unit": "SECONDS" } ### Response #### Success Response (200) - **sessionFuture** (CompletableFuture) - A future resolving to the session. #### Response Example { "status": "connecting", "future": "pending" } ``` -------------------------------- ### GET /sound-events Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/SoundEvent.html Retrieves the list of available sound event constants used for triggering game audio. ```APIDOC ## GET /sound-events ### Description Returns the complete list of SoundEvent enum constants available in the protocol. ### Method GET ### Endpoint /sound-events ### Parameters None ### Request Example GET /sound-events ### Response #### Success Response (200) - **events** (array) - A list of strings representing all available SoundEvent constants (e.g., ITEM_USE_ON, JUMP, BREAK, etc.) #### Response Example { "events": ["ITEM_USE_ON", "JUMP", "BREAK", "PLACE", "STEP"] } ``` -------------------------------- ### ShowCreditsPacket Constructor - Java Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/ShowCreditsPacket.html Initializes a new instance of the ShowCreditsPacket class. This is a default constructor with no parameters. ```java public ShowCreditsPacket() { } ``` -------------------------------- ### BedrockServer Methods Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/BedrockServer.html Details the methods available for managing the BedrockServer instance. ```APIDOC ## BedrockServer Methods ### Description Provides methods for interacting with and managing the `BedrockServer`. ### Methods 1. **`void close(boolean force)`** * Closes the server connection. If `force` is true, it attempts to close immediately. 2. **`void close(String reason)`** * Closes the server connection with a specified reason. 3. **`BedrockServerEventHandler getHandler()`** * Retrieves the current event handler for the server. 4. **`com.nukkitx.network.raknet.RakNetServer getRakNet()`** * Retrieves the underlying RakNet server instance. 5. **`boolean isClosed()`** * Checks if the server has been closed. 6. **`protected void onTick()`** * Called periodically for server ticking logic. (Protected method) 7. **`void setHandler(BedrockServerEventHandler handler)`** * Sets a new event handler for the server. ``` -------------------------------- ### Java Enum Iteration Example Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/PositionTrackingDBClientRequestPacket.Action.html Demonstrates how to iterate over all constants of the PositionTrackingDBClientRequestPacket.Action enum using the values() method. ```java for (PositionTrackingDBClientRequestPacket.Action c : PositionTrackingDBClientRequestPacket.Action.values()) System.out.println(c); ``` -------------------------------- ### GET /protocol/classes Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/package-summary.html Retrieves a list of available data classes and enumerations defined within the NukkitX protocol package. ```APIDOC ## GET /protocol/classes ### Description Returns a comprehensive list of protocol-related classes and enums used for server-client synchronization, including movement modes, block actions, and game rules. ### Method GET ### Endpoint /protocol/classes ### Parameters None ### Response #### Success Response (200) - **classes** (array) - List of available data classes (e.g., AttributeData, BlockChangeEntry, EduSharedUriResource) - **enums** (array) - List of available enumerations (e.g., AuthoritativeMovementMode, PlayerActionType, GameType) #### Response Example { "classes": ["AttributeData", "BlockChangeEntry", "GameRuleData"], "enums": ["AuthoritativeMovementMode", "PlayerActionType"] } ``` -------------------------------- ### Initialize BlockEventPacket Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/BlockEventPacket.html Demonstrates the instantiation of the BlockEventPacket class within the NukkitX framework. ```java BlockEventPacket packet = new BlockEventPacket(); ``` -------------------------------- ### PlayerListPacket Handling Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/class-use/PlayerListPacket.html Demonstrates the method signature for handling PlayerListPacket using the BedrockPacketHandler interface. ```APIDOC ## Handling PlayerListPacket ### Description This section describes the method used by the `BedrockPacketHandler` to process incoming `PlayerListPacket` objects. ### Method `handle(PlayerListPacket packet)` ### Endpoint N/A (Internal handler method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **packet** (PlayerListPacket) - Required - The PlayerListPacket to be handled. ### Request Example ```json { "packet": { ... PlayerListPacket data ... } } ``` ### Response #### Success Response (200) - **boolean** (boolean) - Returns `true` if the packet was handled successfully, `false` otherwise. #### Response Example ```json { "handled": true } ``` ``` -------------------------------- ### ContainerSlotType Enum Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/inventory/class-use/ContainerSlotType.html Documentation for the ContainerSlotType enum, including methods to get enum constants by name or all available constants. ```APIDOC ## ContainerSlotType Enum ### Description Provides information about the `ContainerSlotType` enum, which is used within the `com.nukkitx.protocol.bedrock.data.inventory` package. ### Methods #### `static ContainerSlotType valueOf(String name)` Returns the enum constant of this type with the specified name. #### `static ContainerSlotType[] values()` Returns an array containing the constants of this enum type, in the order they are declared. ``` -------------------------------- ### Constructor BedrockPong Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/BedrockPong.html Initializes a new instance of the BedrockPong class. ```APIDOC ## POST /bedrock/pong ### Description Initializes a new instance of the BedrockPong object used for server discovery and status reporting. ### Method POST ### Endpoint /bedrock/pong ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None - Empty constructor initialization ### Request Example {} ### Response #### Success Response (200) - **status** (string) - Confirmation of object instantiation #### Response Example { "status": "success" } ``` -------------------------------- ### GET /event/fish-bucketed Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/event/FishBucketedEventData.html Retrieves the event type for the FishBucketedEventData class, which is used to identify fish-in-bucket events within the protocol. ```APIDOC ## GET /event/fish-bucketed ### Description Retrieves the EventDataType associated with the FishBucketedEventData event. ### Method GET ### Endpoint /event/fish-bucketed ### Parameters None ### Request Example {} ### Response #### Success Response (200) - **type** (EventDataType) - The specific type identifier for the fish bucketed event. #### Response Example { "type": "FISH_BUCKETED" } ``` -------------------------------- ### Create SerializedSkin Instance Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/skin/SerializedSkin.html Demonstrates how to instantiate a SerializedSkin object using the static 'of' factory method. This method requires parameters such as skin IDs, image data, and geometry information. ```java SerializedSkin skin = SerializedSkin.of("skinId", "playFabId", skinData, capeData, "geometryName", "geometryData", true); ``` -------------------------------- ### GET /protocol/game-types/from Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/GameType.html Retrieves the GameType enum constant corresponding to a specific integer ID used in the Bedrock protocol. ```APIDOC ## GET /protocol/game-types/from ### Description Retrieves the GameType enum constant based on the provided integer ID. This is used to map protocol-level identifiers to internal Java enum representations. ### Method GET ### Endpoint /protocol/game-types/from ### Parameters #### Query Parameters - **id** (int) - Required - The integer identifier representing the game type in the Bedrock protocol. ### Request Example GET /protocol/game-types/from?id=0 ### Response #### Success Response (200) - **gameType** (string) - The name of the GameType constant (e.g., "SURVIVAL", "CREATIVE"). #### Response Example { "gameType": "SURVIVAL" } ``` -------------------------------- ### Manage BedrockServer Lifecycle Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/BedrockServer.html Shows how to retrieve the event handler, check the server status, and close the server connection. ```java if (!server.isClosed()) { server.setHandler(myEventHandler); server.close("Server shutting down"); } ``` -------------------------------- ### GET /ping Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/BedrockClient.html Pings a remote Bedrock server to retrieve server information without establishing a full session. ```APIDOC ## GET /ping ### Description Sends a ping request to the specified address to retrieve server status information (BedrockPong). ### Method GET ### Endpoint /ping ### Parameters #### Query Parameters - **address** (InetSocketAddress) - Required - The server address to ping. - **timeout** (long) - Optional - Timeout duration. ### Request Example { "address": "127.0.0.1:19132" } ### Response #### Success Response (200) - **pong** (BedrockPong) - The server response containing status details. #### Response Example { "motd": "NukkitX Server", "protocolVersion": 448, "playerCount": 10 } ``` -------------------------------- ### Iterating Through SetScorePacket Actions Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/SetScorePacket.Action.html Example of how to iterate through all the constants of the SetScorePacket.Action enum using the values() method and printing each one. ```java for (SetScorePacket.Action c : SetScorePacket.Action.values()) System.out.println(c); ``` -------------------------------- ### Initialize StructureSettings Class Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/structure/StructureSettings.html This snippet demonstrates the definition and instantiation of the StructureSettings class. It is a standard Java class used within the NukkitX protocol framework. ```java public class StructureSettings extends Object { public StructureSettings() { // Default constructor for structure settings } } ``` -------------------------------- ### Build SerializedSkin with Builder Methods (Java) Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/skin/SerializedSkin.Builder.html Demonstrates the use of builder pattern methods to configure and create a SerializedSkin object. Each method sets a specific property of the skin, and the build() method finalizes the object. Dependencies include AnimationData, ImageData, PersonaPieceData, and PersonaPieceTintData. ```Java public static class SerializedSkin.Builder extends Object // Method Summary `SerializedSkin.Builder` | `animationData(String animationData)` `SerializedSkin.Builder` | `animations(List animations)` `SerializedSkin.Builder` | `armSize(String armSize)` `SerializedSkin` | `build()` `SerializedSkin.Builder` | `capeData(ImageData capeData)` `SerializedSkin.Builder` | `capeId(String capeId)` `SerializedSkin.Builder` | `capeOnClassic(boolean capeOnClassic)` `SerializedSkin.Builder` | `fullSkinId(String fullSkinId)` `SerializedSkin.Builder` | `geometryData(String geometryData)` `SerializedSkin.Builder` | `geometryName(String geometryName)` `SerializedSkin.Builder` | `persona(boolean persona)` `SerializedSkin.Builder` | `personaPieces(List personaPieces)` `SerializedSkin.Builder` | `playFabId(String playFabId)` `SerializedSkin.Builder` | `premium(boolean premium)` `SerializedSkin.Builder` | `skinColor(String skinColor)` `SerializedSkin.Builder` | `skinData(ImageData skinData)` `SerializedSkin.Builder` | `skinId(String skinId)` `SerializedSkin.Builder` | `skinResourcePatch(String skinResourcePatch)` `SerializedSkin.Builder` | `tintColors(List tintColors)` `String` | `toString()` // Method Detail `public SerializedSkin.Builder skinId(String skinId)` `public SerializedSkin.Builder playFabId(String playFabId)` `public SerializedSkin.Builder geometryName(String geometryName)` `public SerializedSkin.Builder skinResourcePatch(String skinResourcePatch)` `public SerializedSkin.Builder skinData(ImageData skinData)` `public SerializedSkin.Builder animations(List animations)` `public SerializedSkin.Builder capeData(ImageData capeData)` `public SerializedSkin.Builder geometryData(String geometryData)` `public SerializedSkin.Builder animationData(String animationData)` `public SerializedSkin.Builder premium(boolean premium)` `public SerializedSkin.Builder persona(boolean persona)` `public SerializedSkin.Builder capeOnClassic(boolean capeOnClassic)` `public SerializedSkin.Builder capeId(String capeId)` `public SerializedSkin.Builder fullSkinId(String fullSkinId)` `public SerializedSkin.Builder armSize(String armSize)` `public SerializedSkin.Builder skinColor(String skinColor)` `public SerializedSkin.Builder personaPieces(List personaPieces)` `public SerializedSkin.Builder tintColors(List tintColors)` `public SerializedSkin build()` `public String toString()` ``` -------------------------------- ### Iterating through StructureAnimationMode Constants Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/data/structure/StructureAnimationMode.html Example of how to iterate through all constants of the StructureAnimationMode enum using the `values()` method and print each constant. ```java for (StructureAnimationMode c : StructureAnimationMode.values())   System.out.println(c); ``` -------------------------------- ### BedrockPacketHandler.handle(SetLastHurtByPacket) Source: https://ci.opencollab.dev/job/NukkitX/job/Protocol/job/master/javadoc/com/nukkitx/protocol/bedrock/packet/class-use/SetLastHurtByPacket.html Demonstrates how the BedrockPacketHandler interface handles the SetLastHurtByPacket. ```APIDOC ## BedrockPacketHandler.handle(SetLastHurtByPacket) ### Description This method is part of the BedrockPacketHandler interface and is responsible for processing a `SetLastHurtByPacket`. ### Method default boolean ### Endpoint N/A (Interface method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **packet** (SetLastHurtByPacket) - Required - The packet to be handled. ### Request Example ```json { "packet": { ... SetLastHurtByPacket details ... } } ``` ### Response #### Success Response (200) - **boolean** (boolean) - Indicates if the packet was handled successfully. #### Response Example ```json { "handled": true } ``` ```