### Install Homebrew and Dependencies on macOS Source: https://github.com/geysermc/geyserwebsite/blob/master/CONTRIBUTING.md First, install Homebrew using the provided script. Then, open a new Terminal window to install Node.js, Yarn, and Git. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` ```bash brew install node brew install yarn brew install git ``` -------------------------------- ### Clone and Start Geyser Website Source: https://github.com/geysermc/geyserwebsite/blob/master/README.md Use these commands to clone the Geyser website repository, install its Node.js dependencies using Yarn, and start the local development server. ```sh git clone https://github.com/GeyserMC/GeyserWebsite cd GeyserWebsite yarn yarn start ``` -------------------------------- ### Install Geyser-Standalone using Automated Script on Termux Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/setup/self/standalone.mdx This command downloads and executes an automated setup script for Geyser-Standalone on Termux. It is an alternative to the manual installation steps. ```bash curl https://gist.githubusercontent.com/rtm516/e3e07d6595ee41e05a38b03c0f4d7a80/raw/install.sh | bash ``` -------------------------------- ### Install Dependencies on Windows Source: https://github.com/geysermc/geyserwebsite/blob/master/CONTRIBUTING.md Use PowerShell to install Node.js, Yarn, and Git via winget. Ensure these core development tools are available. ```powershell winget install -e --id OpenJS.NodeJS winget install -e --id Yarn.Yarn winget install -e --id Git.Git ``` -------------------------------- ### Windows Startup Script (run.bat) Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/creating-a-startup-script.md Use this batch script to start Geyser-Standalone on Windows. Ensure Java 21+ is installed and the script is in the same directory as the Geyser-Standalone jar file. ```batch @echo off java -Xms1024M -jar Geyser-Standalone.jar pause ``` -------------------------------- ### Bedrock Options - JSON Example Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/custom-items.mdx Examples of how to define Bedrock-specific options for custom items using JSON mappings. ```APIDOC ## Bedrock Options - JSON Example ### Description Examples of how to define Bedrock-specific options for custom items using JSON mappings. ### Request Example ```json { "bedrock_options": { "icon": "example:chestplate", "protection_value": 4, "creative_category": "equipment", "creative_group": "itemGroup.name.chestplate", "tags": ["example:tag_one", "example:tag_two"] } } ``` ```json { "bedrock_options": { "icon": "example:my_sword", "display_handheld": true, "creative_category": "items", "creative_group": "itemGroup.name.sword", "tags": ["example:my_weapon"] } } ``` ``` -------------------------------- ### Match Predicate Examples (JSON) Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/custom-items.mdx Examples demonstrating how to use the 'match' predicate in JSON format for various properties like charge type, trim material, context dimension, and custom model data. It also shows how to invert the predicate. ```APIDOC ## Match Predicate Examples (JSON) ### Description Examples demonstrating how to use the 'match' predicate in JSON format for various properties like charge type, trim material, context dimension, and custom model data. It also shows how to invert the predicate. ### Predicate Examples #### Charge Type ```json { "predicate": { "type": "match", "property": "charge_type", "value": "arrow" } } ``` #### Trim Material ```json { "predicate": { "type": "match", "property": "trim_material", "value": "minecraft:coast_armor_trim" } } ``` #### Context Dimension ```json { "predicate": { "type": "match", "property": "context_dimension", "value": "minecraft:the_end" } } ``` #### Custom Model Data ```json { "predicate": { "type": "match", "property": "custom_model_data", "value": "MyString", "index": 1 } } ``` #### Inverted Context Dimension ```json { "predicate": { "type": "match", "property": "context_dimension", "value": "minecraft:the_end", "expected": false } } ``` ``` -------------------------------- ### Range Dispatch Predicate Examples (JSON) Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/custom-items.mdx Examples demonstrating how to use the 'range_dispatch' predicate in JSON format for custom item definitions. ```APIDOC ## Range Dispatch Predicate Examples (JSON) ### Description Examples demonstrating how to use the 'range_dispatch' predicate in JSON format for custom item definitions. ### Json mappings #### Example 1: Count Threshold ```json { "predicate": { "type": "range_dispatch", "property": "count", "threshold": 32 } } ``` This predicate evaluates to "true" when the count is equal or above 32. #### Example 2: Normalized Count Threshold ```json { "predicate": { "type": "range_dispatch", "property": "count", "normalize": true, "threshold": 0.5 } } ``` This predicate evaluates to "true" when the normalized count (count / max count; between 0 and 1) is equal to or higher than 0.5. #### Example 3: Scaled Count Threshold ```json { "predicate": { "type": "range_dispatch", "property": "count", "threshold": 8, "scale": 2 } } ``` This predicate evaluates to "true" when the scaled count (count × 2) is greater than or equal to the threshold. #### Example 4: Custom Model Data Index Using the `custom_model_data` range dispatch property requires specifying an index to check. Indexes start at 0 - to check the first element in the floats list, you have to set index to 0: ```json { "predicate": { "type": "range_dispatch", "property": "custom_model_data", "threshold": 3, "index": 0 } } ``` ``` -------------------------------- ### Match Predicate Examples (Geyser API) Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/custom-items.mdx Examples demonstrating how to use match predicates via the Geyser API in Java, utilizing ItemMatchPredicate and MatchPredicate interfaces. ```APIDOC ## Match Predicate Examples (Geyser API) ### Description Examples demonstrating how to use match predicates via the Geyser API in Java, utilizing ItemMatchPredicate and MatchPredicate interfaces. ### API Examples #### Charge Type Predicate ```java .predicate(ItemMatchPredicate.chargeType(ChargedProjectile.ChargeType.ARROW)); ``` #### Dimension Predicate ```java .predicate(MatchPredicate.dimension(Identifier.of("the_end"))); ``` ``` -------------------------------- ### Bedrock Options - Geyser API Example Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/custom-items.mdx Examples of how to define Bedrock-specific options for custom items using the Geyser API (Java). ```APIDOC ## Bedrock Options - Geyser API Example ### Description Examples of how to define Bedrock-specific options for custom items using the Geyser API (Java). ### Request Example ```java .bedrockOptions(CustomItemBedrockOptions.builder() .icon("example:chestplate") .protectionValue(4) .creativeCategory(CreativeCategory.EQUIPMENT) .creativeGroup("itemGroup.name.chestplate") .tags(Set.of(Identifier.of("example:tag_one"), Identifier.of("example:tag_two"))) ) ``` ```java .bedrockOptions(CustomItemBedrockOptions.builder() .icon("example:my_sword") .displayHandheld(true) .creativeCategory(CreativeCategory.ITEMS) .creativeGroup("itemGroup.name.sword") .tag(Identifier.of("example:my_weapon")) ) ``` ``` -------------------------------- ### Example JSON Response Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/downloads.geysermc.org/download-latest.api.mdx This is an example of the JSON response structure you can expect when querying the downloads API. It typically contains metadata about the latest release. ```json {} ``` -------------------------------- ### JSON Response Example for Project Details Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/downloads.geysermc.org/project.api.mdx This JSON structure represents an example response when querying project details from the API. It includes the project ID, name, and a list of available versions. ```json { "project_id": "geyser", "project_name": "Geyser", "versions": [ "string" ] } ``` -------------------------------- ### Range Dispatch Predicate Examples (Geyser API) Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/custom-items.mdx Examples demonstrating how to use the 'range_dispatch' predicate with the Geyser API in Java. ```APIDOC ## Range Dispatch Predicate Examples (Geyser API) ### Description Examples demonstrating how to use the 'range_dispatch' predicate with the Geyser API in Java. ### Geyser API Usage #### Example 1: Count Threshold ```java CustomItemDefinition.builder(..., ...) .predicate(ItemRangeDispatchPredicate.count(32)) .build(); ``` This predicate evaluates to "true" when the count is equal or above 32. #### Example 2: Normalized Count Threshold ```java CustomItemDefinition.builder(..., ...) .predicate(ItemRangeDispatchPredicate.normalizedCount(0.5)) .build(); ``` This predicate evaluates to "true" when the normalized count (count / max count; between 0 and 1) is equal to or higher than 0.5. #### Example 3: Custom Model Data Index ```java CustomItemDefinition.builder(..., ...) .predicate(ItemRangeDispatchPredicate.customModelData(1, 12)) .build(); ``` This predicate evaluates to "true" when the second index of the floats list in the `custom_model_data` component is present and is equal to or higher than 12. To scale a property, divide the threshold by the scale factor. ``` -------------------------------- ### Example JSON Response Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-stats-controller-get-all-stats.api.mdx This is an example of the JSON response structure you can expect when calling the API to get all stats. It includes the length of the pre-upload queue and the length and estimated duration of the active upload queue. ```json { "pre_upload_queue": { "length": 0 }, "upload_queue": { "estimated_duration": 0, "length": 0 } } ``` -------------------------------- ### Get Builds Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/downloads.geysermc.org/builds.api.mdx Retrieves a list of all available builds for a given project and version. ```APIDOC ## GET /v2/projects/{project}/versions/{version}/builds ### Description Gets all available builds for a project's version. ### Method GET ### Endpoint /v2/projects/{project}/versions/{version}/builds ### Parameters #### Path Parameters - **project** (string) - Required - The project identifier. - **version** (string) - Required - A version of the project. ### Response #### Success Response (200) OK ``` -------------------------------- ### Get Build Information Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/downloads.geysermc.org/build-specific.api.mdx Retrieves information about a specific build for a given project and version. ```APIDOC ## GET /v2/projects/{project}/versions/{version}/builds/{build} ### Description Gets information related to a specific build. ### Method GET ### Endpoint /v2/projects/{project}/versions/{version}/builds/{build} ### Parameters #### Path Parameters - **project** (string) - Required - The project identifier. - **version** (string) - Required - A version of the project. - **build** (integer) - Required - A build of the version. ### Response #### Success Response (200) OK ``` -------------------------------- ### Get Projects Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/downloads.geysermc.org/projects.api.mdx Retrieves a list of all available projects hosted on GeyserMC Downloads. ```APIDOC ## GET /v2/projects ### Description Gets a list of all available projects. ### Method GET ### Endpoint /v2/projects ### Response #### Success Response (200) - **projects** (string[]) - Description of the projects array #### Response Example ```json { "projects": [ "string" ] } ``` ``` -------------------------------- ### Get All Stats Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-stats-controller-get-all-stats-2.api.mdx Fetches statistics for skin upload queues. ```APIDOC ## GET /api/web/api/stats ### Description Retrieves statistics about the pre-upload queue and the active upload queue. ### Method GET ### Endpoint /api/web/api/stats ### Response #### Success Response (200) - **pre_upload_queue** (object) - Information about the pre-upload queue. - **length** (integer) - The amount of skins in the pre-upload queue. - **upload_queue** (object) - Information about the active upload queue. - **estimated_duration** (decimal) - Estimated duration to upload 'length' amount of skins. - **length** (integer) - The amount of skins in the upload queue. #### Response Example { "pre_upload_queue": { "length": 0 }, "upload_queue": { "estimated_duration": 0, "length": 0 } } ``` -------------------------------- ### Get All Stats Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-stats-controller-get-all-stats.api.mdx Retrieves statistics for skin upload queues. ```APIDOC ## GET /api/web/api/stats ### Description Retrieves statistics related to skin upload queues, including the pre-upload queue and the main upload queue. ### Method GET ### Endpoint /api/web/api/stats ### Response #### Success Response (200) - **pre_upload_queue** (object) - Information about the pre-upload queue. - **length** (integer) - The amount of skins in the pre-upload queue. - **upload_queue** (object) - Information about the upload queue. - **estimated_duration** (decimal) - Estimated duration to upload 'length' amount of skins. - **length** (integer) - The amount of skins in the upload queue. #### Response Example { "pre_upload_queue": { "length": 0 }, "upload_queue": { "estimated_duration": 0, "length": 0 } } ``` -------------------------------- ### Get Project Information Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/downloads.geysermc.org/project.api.mdx Retrieves detailed information about a specific project, including its ID, name, and versions. ```APIDOC ## GET /v2/projects/{project} ### Description Gets information about a project. ### Method GET ### Endpoint /v2/projects/{project} ### Parameters #### Path Parameters - **project** (string) - Required - The project identifier. Example: geyser ### Response #### Success Response (200) - **project_id** (string) - The unique identifier for the project. Example: geyser - **project_name** (string) - The display name of the project. Example: Geyser - **versions** (array) - A list of available versions for the project. ``` -------------------------------- ### Get Latest Build Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/downloads.geysermc.org/build-latest.api.mdx Retrieves information about the latest build for a specified project and version. ```APIDOC ## GET /v2/projects/{project}/builds/latest ### Description Gets information related to a specific build. ### Method GET ### Endpoint /v2/projects/{project}/versions/{version}/builds/latest ### Parameters #### Path Parameters - **project** (string) - Required - The project identifier. - **version** (string) - Required - A version of the project. ### Response #### Success Response (302) Found ``` -------------------------------- ### Run Hydraulic Server Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/other/hydraulic.md This command runs a server with Hydraulic installed. Make sure Geyser is present in the mods folder. ```bash ./gradlew :fabric:runServer ``` -------------------------------- ### Get Project Details Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/downloads.geysermc.org/project.api.mdx Retrieves information about a specific project. This includes the project ID, project name, and a list of its available versions. ```APIDOC ## GET /projects/{projectId} ### Description Retrieves details for a specific project, including its ID, name, and versions. ### Method GET ### Endpoint /projects/{projectId} ### Parameters #### Path Parameters - **projectId** (string) - Required - The unique identifier of the project. ### Response #### Success Response (200) - **project_id** (string) - The unique identifier of the project. - **project_name** (string) - The display name of the project. - **versions** (string[]) - A list of available versions for the project. #### Response Example ```json { "project_id": "geyser", "project_name": "Geyser", "versions": [ "string" ] } ``` ``` -------------------------------- ### Build and Serve Geyser Website (Production) Source: https://github.com/geysermc/geyserwebsite/blob/master/CONTRIBUTING.md Build the production version of the website and then start a local server to test it. This build step is required for merging changes. ```sh yarn build yarn serve ``` -------------------------------- ### Create a New Documentation Page Source: https://github.com/geysermc/geyserwebsite/blob/master/CONTRIBUTING.md Example layout for a new documentation page using Markdown. Pages should include a title and description in the frontmatter. ```md --- title: Page title description: A short description of the page. --- ## Page Subheading One {#page-subheading-1} This is an example page. ## Page Subheading Two {#page-subheading-2} This is more of an example page. ``` -------------------------------- ### Register Geyser Event Bus in Fabric Mod Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/events.md Register the Geyser event bus within the server starting event for Fabric mods, as the Geyser API may not be loaded during the ModInitializer. This example shows how to subscribe to GeyserPostInitializeEvent. ```java import org.geysermc.geyser.api.GeyserApi; import org.geysermc.geyser.api.event.EventRegistrar; import org.geysermc.geyser.api.event.Subscribe; import org.geysermc.geyser.api.event.lifecycle.GeyserPostInitializeEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import net.fabricmc.api.ModInitializer; import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents; public class ExampleMod implements ModInitializer, EventRegistrar { public static final Logger LOGGER = LoggerFactory.getLogger("modid"); @Override public void onInitialize() { ServerLifecycleEvents.SERVER_STARTING.register((server) -> { GeyserApi.api().eventBus().register(this, this); // register your mod & this class instance as a listener }); LOGGER.info("Geyser is cool!"); } // here an event, we subscribe as usual with the @Subscribe annotation @Subscribe public void onGeyserPostInitializeEvent(GeyserPostInitializeEvent event) { LOGGER.info("Geyser started!"); } } ``` -------------------------------- ### Get XUID by Gamertag Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-xbox-controller-get-xuid-v-2.api.mdx This snippet demonstrates how to call the API to get the XUID for a specific gamertag. ```APIDOC ## GET /api/v2/xbox/xuid ### Description Retrieves the Xbox User ID (XUID) for a given gamertag. ### Method GET ### Endpoint /api/v2/xbox/xuid ### Parameters #### Query Parameters - **gamertag** (string) - Required - The gamertag of the Xbox user. ### Response #### Success Response (200) - **message** (string) - The XUID of the user if found, otherwise an error message. ``` -------------------------------- ### Reproduction Attempt: Multiple Connection Requests Source: https://github.com/geysermc/geyserwebsite/blob/master/blog/2024-05-05-raknet-amplification-attack.md This demonstrates a naive approach to reproducing the amplification by sending numerous 'Connection Request' packets upon receiving 'Open Connection Reply 2'. This results in the server sending multiple 'Connection Request Accepted' packets, indicating a potential for abuse. ```text Sending many Connection Request packets once receiving Open Connection Reply 2 from the server. ``` -------------------------------- ### JSON Response Example Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-skin-controller-get-recent-uploads-page.api.mdx This is an example of the JSON response structure you can expect when calling the API. It includes a message field. ```json { "message": "string" } ``` -------------------------------- ### Example Custom Block Mappings File Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/custom-blocks.md This JSON file demonstrates how to register custom blocks, including geometry, material instances, tags, and state overrides. Custom mappings should be placed in the `custom_mappings` folder. ```json { "format_version": 1, "blocks": { "minecraft:granite_wall": { "name": "my_block", "display_name": "Custom Granite Wall", "geometry": "geometry.blocks.my_block_geo", "material_instances": { "*": { "texture": "some_texture", "render_method": "alpha_test", "face_dimming": true, "ambient_occlusion": true } }, "tags": ["stone", "wall"], "state_overrides": { "east=none,north=none,south=none,up=true,waterlogged=true,west=none": { "geometry": "geometry.blocks.my_other_block_geo", "destructible_by_mining": 10, "place_air": false }, "east=none,north=none,south=none,up=false,waterlogged=true,west=tall": { "friction": 0.6, "light_emission": 7, "light_dampening": 8, "transformation": { "scale": [0.5, 0.5, 0.5], "translation": [1, 0, 0], "rotation": [0, 90, 0] } }, "east=none,north=none,south=low,up=true,waterlogged=true,west=tall": { "placement_filter": { "conditions": [{ "allowed_faces": ["up", "down"], "block_filter": [{ "tags": "!query.any_tag('stone')" }, "minecraft:dirt" ] }] } } } } } } ``` -------------------------------- ### Linux Startup Script (run.sh) Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/creating-a-startup-script.md This shell script starts Geyser-Standalone on Linux. It navigates to the script's directory before execution. Ensure the script has execute permissions (`chmod +x`). ```shell #!/bin/sh cd "$( dirname "$0" )" java -Xms1024M -jar Geyser-Standalone.jar ``` -------------------------------- ### Build a CustomForm Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/forms.md Demonstrates building a CustomForm with various components like dropdown, input, toggle, and slider. Ensure all necessary components are imported from the Cumulus library. ```java CustomForm.builder() .title("Title") .dropdown("Text", "Option 1", "Option 2") .input("Input", "placeholder") .toggle("Toggle") .slider("Text", 0, 10, 1, 5) ``` -------------------------------- ### Build and Register a Custom Command Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/extensions.md Define a custom command using the Command.builder and register it with the GeyserDefineCommandsEvent. This example creates a simple command that sends a message to the source. Ensure the command is registered within the onDefineCommands method. ```java Command command = Command.builder(this) // "this" is the extension's main class .name("ExampleCommand") .bedrockOnly(true) .source(CommandSource.class) .aliases(List.of("example", "ex")) .description("An example command") .executableOnConsole(false) .suggestedOpOnly(false) .permission("example.command") .executor((source, cmd, args) -> { // this is the command executor - this is where you would put your code to execute the command. // source is the source that executed the command // cmd is the command that was executed // args are the arguments passed to the command source.sendMessage("Hello World"); }) .build(); ``` ```java @Subscribe public void onDefineCommands(GeyserDefineCommandsEvent event) { event.register(command); } ``` -------------------------------- ### macOS Startup Script (run.command) Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/creating-a-startup-script.md This shell script is used to start Geyser-Standalone on macOS. It changes the directory to the script's location before running the jar. Make the script executable using `chmod a+x`. ```shell #!/bin/bash cd "$( dirname "$0" )" java -Xms1024M -jar Geyser-Standalone.jar ``` -------------------------------- ### Get Gamertag by XUID Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-xbox-controller-get-gamertag-v-2.api.mdx Retrieves the gamertag for a given Xbox User ID. ```APIDOC ## GET /api/v2/xbox/controller/gamertag/{xuid} ### Description Retrieves the gamertag for a given Xbox User ID. ### Method GET ### Endpoint /api/v2/xbox/controller/gamertag/{xuid} ### Parameters #### Path Parameters - **xuid** (string) - Required - The Xbox User ID to look up. ### Response #### Success Response (200) - **gamertag** (string) - The gamertag associated with the XUID. ### Request Example ```json { "gamertag": "Tim203" } ``` #### Error Response (400) - **message** (string) - The error message indicating an invalid XUID. #### Error Response (503) - **message** (string) - The error message indicating the account was not cached or the Xbox Live API could not be reached. ``` -------------------------------- ### Get Front Texture Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-render-controller-get-front-texture.api.mdx Retrieves a front texture using its unique ID. ```APIDOC ## GET /render/front/{texture_id} ### Description Retrieves a front texture using its unique ID. ### Method GET ### Endpoint /render/front/{texture_id} ### Parameters #### Path Parameters - **texture_id** (string) - Required - Java texture id ### Response #### Success Response (200) - **ok** (string) - Description: ok ``` -------------------------------- ### Get Bedrock Link V1 Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-link-controller-get-bedrock-link-v-1.api.mdx Fetches the Bedrock link for a given xuid. ```APIDOC ## GET /v1/link/bedrock/{xuid} ### Description Retrieves the Bedrock link information for a given xuid. ### Method GET ### Endpoint /v1/link/bedrock/{xuid} ### Parameters #### Path Parameters - **xuid** (string) - Required - Bedrock xuid ### Response #### Success Response (200) - **field1** (type) - Description #### Response Example { "example": "response body" } :::caution deprecated ::: ``` -------------------------------- ### GeyserApi Methods Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/api.md Highlights key methods available through the GeyserApi instance for interacting with Bedrock players and connections. ```APIDOC ## GeyserApi Methods ### Description These are some of the commonly used methods available through the `GeyserApi` instance. ### `isBedrockPlayer(UUID)` #### Description Used to check if the given UUID of an **online** player is a Bedrock player. ### `connectionByUuid(UUID)` #### Description Used to get the [Connection](https://github.com/GeyserMC/api/blob/master/base/src/main/java/org/geysermc/api/connection/Connection.java) of an **online** player. This method will return null if the player is not a Bedrock player. ### `sendForm(UUID, Form(Builder))` #### Description Used to send a form to the Bedrock player with the given UUID. Click [here](/wiki/geyser/forms/) to get more information about Forms. ### `onlineConnectionsCount()` #### Description Used to get the amount of online Bedrock players. ### Note You don't need to wait until the Bedrock player is online to use the `getPlayer` and `isBedrockPlayer` methods. You can even use them in the pre-login events. ``` -------------------------------- ### Get Recent Skin Uploads Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-skin-controller-get-recent-uploads-page.api.mdx Retrieves a paginated list of recent skin uploads. ```APIDOC ## GET /api/v1/skin/recent ### Description Retrieves a paginated list of recent skin uploads. This endpoint is useful for displaying the latest skins uploaded to the platform. ### Method GET ### Endpoint /api/v1/skin/recent ### Query Parameters - **page** (integer) - Optional - The page number to retrieve. Defaults to 0. - **limit** (integer) - Optional - The maximum number of skins to return per page. Defaults to 10. ### Response #### Success Response (200) - **skins** (array) - An array of skin objects. - **id** (string) - The unique identifier for the skin. - **name** (string) - The name of the skin. - **uploader** (string) - The username of the uploader. - **upload_date** (string) - The date and time the skin was uploaded (ISO 8601 format). - **thumbnail_url** (string) - The URL to a thumbnail of the skin. #### Response Example ```json { "skins": [ { "id": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "name": "My Awesome Skin", "uploader": "Player123", "upload_date": "2023-10-27T10:00:00Z", "thumbnail_url": "https://api.geysermc.org/v1/skin/thumbnail/a1b2c3d4-e5f6-7890-1234-567890abcdef" } ] } ``` ``` -------------------------------- ### Build Hydraulic Jar Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/other/hydraulic.md Use this command to compile a jar file for Hydraulic. Ensure Geyser is also in your mods folder. ```bash ./gradlew build ``` -------------------------------- ### Get Gamertag Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-xbox-controller-get-gamertag-v-2.api.mdx Retrieves the Xbox gamertag associated with a given Xbox User ID. ```APIDOC ## GET /api/xbox/gamertag ### Description Retrieves the Xbox gamertag associated with a given Xbox User ID. ### Method GET ### Endpoint /api/xbox/gamertag ### Parameters #### Query Parameters - **xuid** (string) - Required - The Xbox User ID for which to retrieve the gamertag. ### Response #### Success Response (200) - **gamertag** (string) - The Xbox gamertag. - **xuid** (string) - The Xbox User ID. #### Response Example ```json { "gamertag": "ExampleGamer", "xuid": "1234567890123456" } ``` ``` -------------------------------- ### Example API Response for Project Version Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/downloads.geysermc.org/version.api.mdx This JSON object represents a typical response from the Geyser Downloads API, detailing project ID, name, version, and available builds. ```json { "project_id": "geyser", "project_name": "Geyser", "version": "2.1.0", "builds": [ 0 ] } ``` -------------------------------- ### Handle GeyserPostInitializeEvent in Extension Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/extensions.md Use this event to perform actions after Geyser has fully initialized. The GeyserAPI is available at this stage. Subscribe to this event using the @Subscribe annotation. ```java @Subscribe public void onPostInitialize(GeyserPostInitializeEvent event) { // example: show that your extension is loading. this.logger().info("Loading example extension..."); } ``` -------------------------------- ### Create Resource Pack from Path Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/api.md Creates a resource pack from a given file path using PathPackCodec. This is useful for loading Bedrock resource packs from local storage. ```java ResourcePack pack = ResourcePack.create(PackCodec.path(path)); ``` -------------------------------- ### Get Bedrock Player Skin Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-skin-controller-get-skin.api.mdx Retrieves the most recently converted skin of a Bedrock player. ```APIDOC ## GET /v2/skin/{xuid} ### Description Get the most recently converted skin of a Bedrock player. ### Method GET ### Endpoint /v2/skin/{xuid} ### Parameters #### Path Parameters - **xuid** (string) - Required - Bedrock xuid ### Response #### Success Response (200) - **hash** (string) - The hash of the skin bytes ``` -------------------------------- ### Registering Game Packets in MCProtocolLib (Old Method) Source: https://github.com/geysermc/geyserwebsite/blob/master/blog/2021-12-28-1-18-release-and-more.md This code snippet illustrates the previous method in MCProtocolLib where game packets were registered individually for each player every time the protocol state changed. This approach led to performance issues due to repeated map population. ```java private void initGame(BiConsumer> clientboundPackets, BiConsumer> serverboundPackets) { clientboundPackets.accept(0x00, ServerSpawnEntityPacket.class); clientboundPackets.accept(0x01, ServerSpawnExpOrbPacket.class); clientboundPackets.accept(0x02, ServerSpawnLivingEntityPacket.class); clientboundPackets.accept(0x03, ServerSpawnPaintingPacket.class); clientboundPackets.accept(0x04, ServerSpawnPlayerPacket.class); clientboundPackets.accept(0x05, ServerAddVibrationSignalPacket.class); clientboundPackets.accept(0x06, ServerEntityAnimationPacket.class); clientboundPackets.accept(0x07, ServerStatisticsPacket.class); clientboundPackets.accept(0x08, ServerPlayerActionAckPacket.class); clientboundPackets.accept(0x09, ServerBlockBreakAnimPacket.class); clientboundPackets.accept(0x0A, ServerUpdateTileEntityPacket.class); clientboundPackets.accept(0x0B, ServerBlockValuePacket.class); clientboundPackets.accept(0x0C, ServerBlockChangePacket.class); clientboundPackets.accept(0x0D, ServerBossBarPacket.class); clientboundPackets.accept(0x0E, ServerDifficultyPacket.class); clientboundPackets.accept(0x0F, ServerChatPacket.class); clientboundPackets.accept(0x10, ServerClearTitlesPacket.class); clientboundPackets.accept(0x11, ServerTabCompletePacket.class); clientboundPackets.accept(0x12, ServerDeclareCommandsPacket.class); clientboundPackets.accept(0x13, ServerCloseWindowPacket.class); clientboundPackets.accept(0x14, ServerWindowItemsPacket.class); clientboundPackets.accept(0x15, ServerWindowPropertyPacket.class); clientboundPackets.accept(0x16, ServerSetSlotPacket.class); clientboundPackets.accept(0x17, ServerSetCooldownPacket.class); clientboundPackets.accept(0x18, ServerPluginMessagePacket.class); // this continues for more than 100 more packets ``` -------------------------------- ### Get Recent Uploads Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-skin-controller-get-recent-uploads-page.api.mdx Fetches a list of recent skin uploads, paginated by page number. ```APIDOC ## GET /api/web/skin/recent-uploads ### Description Retrieves a paginated list of recent skin uploads. ### Endpoint /api/web/skin/recent-uploads ### Query Parameters - **page** (integer) - Optional - The page number to retrieve. Defaults to 0. ### Response #### Success Response (200) - **data** (object[]) - An array of skin objects. - **id** (integer) - Required - The converted skin id. - **texture_id** (string) - Required - The texture id used by Minecraft. - **total_pages** (integer) - Optional - The amount of pages available. ### Response Example ```json { "data": [ { "id": 0, "texture_id": "string" } ], "total_pages": 0 } ``` #### Error Response (400) - **message** (string) - Description of the error, e.g., "Invalid page number (e.g. negative, decimal, too large)" ``` -------------------------------- ### Specify Alternative Config File Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/geyser-command-line-arguments-and-system-properties.md Points to an alternative configuration file to use for Geyser. The alias for this option is `-c`. ```bash --config [file] ``` ```bash -c [file] ``` -------------------------------- ### Get all Global API statistics Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-stats-controller-get-all-stats.api.mdx This endpoint retrieves all publicly available statistics from the Global API. ```APIDOC ## GET /v1/stats ### Description Retrieves all publicly available statistics from the Global API. ### Method GET ### Endpoint /v1/stats ### Response #### Success Response (200) - **pre_upload_queue** (object) - Statistics related to the pre-upload queue. - **length** (integer) - The number of items in the queue. ``` -------------------------------- ### Get Raw Texture Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-render-controller-get-raw-texture.api.mdx Fetches the raw texture data associated with a specific texture ID. ```APIDOC ## GET /render/raw/{texture_id} ### Description Retrieves the raw texture data for a given texture ID. ### Method GET ### Endpoint /render/raw/{texture_id} ### Parameters #### Path Parameters - **texture_id** (string) - Required - Java texture id ### Response #### Success Response (200) - **ok** (string) - Description of the success response ``` -------------------------------- ### Example Paper Server Item Dump Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/geyser/custom-skulls.md This log shows the NBT data output from the `/paper dumpitem` command, which includes the texture string for custom skulls. ```log [05:58:07 INFO]: .KastleFirefox issued server command: /paper dumpitem [05:58:07 INFO]: minecraft:player_head{display: {Name: '{"text":"Test"}'}, SkullOwner: {Properties: {textures: [{Value: "ewogICJ0aW1lc3RhbXAiIDogMTY1NzMyMjIzOTgzMywKICAicHJvZmlsZUlkIiA6ICJjZGRiZTUyMGQwNDM0YThiYTFjYzlmYzkyZmRlMmJjZiIsCiAgInByb2ZpbGVOYW1lIiA6ICJkYXZjaG9vIiwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2E5MDc5MGM1N2UxODFlZDEzYWRlZDE0YzQ3ZWUyZjdjOGRlMzUzM2UwMTdiYTk1N2FmN2JkZjlkZjFiZGU5NGYiLAogICAgICAibWV0YWRhdGEiIDogewogICAgICAgICJtb2RlbCIgOiAic2xpbSIKICAgICAgfQogICAgfQogIH0KfQ"}]}, Id: [I; -229048314, -553040501, -1407961158, 465313087]}} ``` -------------------------------- ### Get Java Link Source: https://github.com/geysermc/geyserwebsite/blob/master/wiki/api/api.geysermc.org/global-api-web-api-link-controller-get-java-link-v-1.api.mdx Retrieves a Java link using a provided UUID. This endpoint is deprecated. ```APIDOC ## GET /v1/link/java/{uuid} ### Description Retrieves a Java link using a provided UUID. ### Method GET ### Endpoint /v1/link/java/{uuid} ### Parameters #### Path Parameters - **uuid** (string) - Required - Java UUID ### Response #### Success Response (200) This endpoint is deprecated and may not return a valid response. #### Response Example ```json { "example": "response body" } ``` :::caution deprecated ::: ```