### BungeeCord Floodgate Setup Example Source: https://geysermc.org/wiki/geyser/common-issues This outlines the required Floodgate installation on a BungeeCord setup. Ensure Floodgate is installed on all Spigot backend servers and that the 'key.pem' and 'config.yml' are consistent across all servers. ```text 1. Bungee: Geyser and Floodgate 2. Lobby: floodgate 3. Server-1: floodgate 4. Server-2: floodgate ``` -------------------------------- ### GET Request Example for Front Texture Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-render-controller-get-front-texture Demonstrates how to fetch a front texture using a provided texture ID via an HTTP GET request. Requires the texture_id as a path parameter. This example uses C# and HttpClient. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.geysermc.org/render/front/:texture_id"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://geysermc.org/wiki/api/downloads.geysermc.org/build-latest Example of how to use HttpClient in C# to make a GET request to the GeyserMC Downloads API for the latest build information. Ensure the response is successful before reading the content. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://download.geysermc.org/v2/projects/:project/versions/:version/builds/latest"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Project Information (C# HttpClient) Source: https://geysermc.org/wiki/api/downloads.geysermc.org/project Example using C#'s HttpClient to fetch project details. Ensure the 'Accept' header is set to 'application/json'. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://download.geysermc.org/v2/projects/:project"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-skin-controller-get-recent-uploads-page Example of how to make a GET request to the recent uploads API using HttpClient in C#. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.geysermc.org/v2/skin/bedrock/recent/:page"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-xbox-controller-get-xuid-v-2 This C# code demonstrates how to use HttpClient to make a GET request to the GeyserMC API to fetch an XUID. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.geysermc.org/v2/xbox/xuid/:gamertag"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example API Response for Builds Source: https://geysermc.org/wiki/api/downloads.geysermc.org/builds An example JSON response structure for the 'Get Builds for Project Version' API endpoint. It shows details about projects, versions, builds, changes, and downloads. ```json { "project_id": "geyser", "project_name": "Geyser", "version": "2.1.0", "builds": [ { "build": 30, "time": "2024-07-14T21:42:40.604Z", "channel": "default", "promoted": true, "changes": [ { "commit": "string", "summary": "string", "message": "string" } ], "downloads": {} } ] } ``` -------------------------------- ### Version Information Response Example Source: https://geysermc.org/wiki/api/downloads.geysermc.org/version An example JSON response containing details about a project version, including its ID, name, version string, and build numbers. ```json { "project_id": "geyser", "project_name": "Geyser", "version": "2.1.0", "builds": [ 0 ] } ``` -------------------------------- ### C# HttpClient Example Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-health-controller-health Example using C# HttpClient to send a GET request to the GeyserMC API health endpoint. Ensures the response is successful and prints the content. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.geysermc.org/health"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-stats-controller-get-all-stats-2 Example of how to fetch statistics using HttpClient in C#. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.geysermc.org/v2/stats"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### C# HttpClient Example Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-stats-controller-get-all-stats Example of how to fetch statistics using HttpClient in C#. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.geysermc.org/v1/stats"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Project Information JSON Response Example Source: https://geysermc.org/wiki/api/downloads.geysermc.org/project An example of the JSON response structure when requesting project information. Includes project ID, name, and a list of versions. ```json { "project_id": "geyser", "project_name": "Geyser", "versions": [ "string" ] } ``` -------------------------------- ### Windows Startup Script for Geyser-Standalone Source: https://geysermc.org/wiki/geyser/creating-a-startup-script 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 ``` -------------------------------- ### C# HttpClient Example Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-skin-controller-get-recent-uploads This C# code snippet demonstrates how to use HttpClient to make a GET request to the GeyserMC API to fetch recent Bedrock skins. Ensure the 'Accept' header is set to 'application/json'. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.geysermc.org/v2/skin/bedrock/recent"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example JSON Response (Success) Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-skin-controller-get-recent-uploads-page This is an example of a successful JSON response containing skin data and total page count. ```json { "data": [ { "id": 0, "texture_id": "string" } ], "total_pages": 0 } ``` -------------------------------- ### Get Project Information (HTTP) Source: https://geysermc.org/wiki/api/downloads.geysermc.org/project Demonstrates how to make an HTTP GET request to retrieve information about a specific project. Replace ':project' with the actual project identifier. ```http GET ## https://download.geysermc.org/v2/projects/:project ``` -------------------------------- ### Example mappings.json Structure Source: https://geysermc.org/wiki/geyser/custom-items Illustrates the basic structure of a mappings.json file, including format version and item definitions. ```json { "format_version": 2, "items": { "minecraft:flint": [ // definition ], "minecraft:apple": [ // definition1, // definition2 ], "minecraft:diamond": [ // definition ] } } ``` -------------------------------- ### C# HttpClient Example Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-utils-controller-get-bedrock-or-java-uuid This C# code snippet demonstrates how to use HttpClient to make a GET request to the GeyserMC API endpoint for retrieving player UUIDs. Ensure you handle the response appropriately. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.geysermc.org/v2/utils/uuid/bedrock_or_java/:username"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Retrieve Build Information using HttpClient (C#) Source: https://geysermc.org/wiki/api/downloads.geysermc.org/build-specific Example of how to fetch build information using C#'s HttpClient. Ensure the 'Accept' header is set to 'application/json'. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://download.geysermc.org/v2/projects/:project/versions/:version/builds/:build"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example JSON Item Components Source: https://geysermc.org/wiki/geyser/custom-items Shows how to define item components like max stack size and enchantment glint override in JSON format. ```json "components": { "minecraft:max_stack_size": 16, "minecraft:enchantment_glint_override": true } ``` -------------------------------- ### Automated Geyser Standalone Install Script for Termux Source: https://geysermc.org/wiki/geyser/setup/self/standalone A script to automate the download and installation of Geyser Standalone on Termux. This is an alternative to the manual steps. ```bash curl https://gist.githubusercontent.com/rtm516/e3e07d6595ee41e05a38b03c0f4d7a80/raw/install.sh | bash ``` -------------------------------- ### Example extension.yml Configuration Source: https://geysermc.org/wiki/geyser/extensions Defines the metadata and dependencies for a Geyser extension. Ensure the `id` is unique and lowercase. ```yaml id: exampleid name: ExampleExtension main: org.geyser.extension.exampleid.ExampleExtension api: 2.9.0 version: 1.0.0 authors: [ExampleAuthor] dependencies: # Optional exampledependency: # When this dependency should be loaded (BEFORE or AFTER your extension) load: BEFORE # Default: BEFORE # This determines whether or not this dependency is required for this extension to load required: true # Default: true ``` -------------------------------- ### Example JSON for Removing a Component Source: https://geysermc.org/wiki/geyser/custom-items Shows how to remove a default component, such as the food component from an apple, using JSON. ```json "components": { "!minecraft:food": {} } ``` -------------------------------- ### Create a ModalForm Source: https://geysermc.org/wiki/geyser/forms Example of creating a basic ModalForm with a title, content, and two buttons. Use this for simple confirmations or choices. ```java ModalForm.builder() .title("Title") .content("Content") .button1("Button 1") .button2("Button 2") ``` -------------------------------- ### Example JSON Response for Bedrock Player Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-utils-controller-get-bedrock-or-java-uuid This is an example of a successful JSON response when the username corresponds to a Bedrock player. It includes the player's Floodgate UUID and username. ```json { "id": "0000000000000000000901f64f65c7c3", "name": ".Tim203" } ``` -------------------------------- ### Get Build Information Source: https://geysermc.org/wiki/api/downloads.geysermc.org/build-specific Retrieves detailed information for a specific project version build. ```APIDOC ## GET /v2/projects/:project/versions/:version/builds/:build ### Description Gets information related to a specific build. ### Method GET ### Endpoint https://download.geysermc.org/v2/projects/:project/versions/:version/builds/:build ### Parameters #### Path Parameters - **project** (string) - Required - The project identifier. Must match regex `[a-z]+`. Example: geyser - **version** (string) - Required - A version of the project. Must match regex `(?:latest|[0-9.]+-?(?:pre|SNAPSHOT)?(?:[0-9.]+)?)?` - **build** (integer) - Required - A build of the version. Must match regex `\d+` ### Responses #### Success Response (200 OK) - **project_id** (string) - The project identifier. - **project_name** (string) - The name of the project. - **version** (string) - The project version. - **build** (integer) - The build number. - **time** (string) - The date-time the build was created. - **channel** (string) - The build channel (e.g., `default`, `experimental`). - **promoted** (boolean) - Indicates if the build is promoted. - **changes** (array) - An array of changes for the build. - **commit** (string) - The commit hash. - **summary** (string) - A summary of the commit. - **message** (string) - The full commit message. - **downloads** (object) - An object containing download information. - **[property name]** (object) - Details for a specific download. - **name** (string) - The name of the download file. - **sha256** (string) - The SHA256 hash of the download file. ### Response Example ```json { "project_id": "geyser", "project_name": "Geyser", "version": "2.1.0", "build": 30, "time": "2024-07-14T21:42:40.605Z", "channel": "default", "promoted": true, "changes": [ { "commit": "string", "summary": "string", "message": "string" } ], "downloads": {} } ``` ``` -------------------------------- ### Send a CustomForm Compactly Source: https://geysermc.org/wiki/geyser/forms A concise example of creating and sending a CustomForm in a single operation, combining form building and sending logic. ```java FloodgatePlayer player = FloodgateApi.getInstance().getPlayer(uuid); ... player.sendForm( CustomForm.builder() .title("My cool title") .label("10/10 content") ); ``` -------------------------------- ### Implement Geyser Extension Source: https://geysermc.org/wiki/geyser/custom-blocks Start by creating a Java class that implements Geyser's Extension interface. ```java public class RedstoneDot implements Extension { //... } ``` -------------------------------- ### Get Builds for Project Version Source: https://geysermc.org/wiki/api/downloads.geysermc.org/builds Retrieves all available builds for a specific project and version. This is useful for listing available releases or checking for updates. ```http GET ## https://download.geysermc.org/v2/projects/:project/versions/:version/builds ``` -------------------------------- ### Get Version Information Source: https://geysermc.org/wiki/api/downloads.geysermc.org/version Retrieves detailed information about a specific project version using its identifier and version number. ```http GET ## https://download.geysermc.org/v2/projects/:project/versions/:version ``` -------------------------------- ### Create a CustomForm with Various Components Source: https://geysermc.org/wiki/geyser/forms Example of creating a CustomForm, which offers the highest level of customization. This snippet demonstrates using dropdowns, input fields, toggles, and sliders. ```java CustomForm.builder() .title("Title") .dropdown("Text", "Option 1", "Option 2") .input("Input", "placeholder") .toggle("Toggle") .slider("Text", 0, 10, 1, 5) ``` -------------------------------- ### Get All Projects Source: https://geysermc.org/wiki/api/downloads.geysermc.org/projects Use this endpoint to retrieve a list of all available projects. The response will be a JSON object containing an array of project names. ```http GET /v2/projects ``` -------------------------------- ### Create a SimpleForm with Images Source: https://geysermc.org/wiki/geyser/forms Example of creating a SimpleForm with text-only buttons and buttons that include images from URLs or local paths. Suitable for menus with visual elements. ```java SimpleForm.builder() .title("Title") .content("Content") .button("Button without an image") .button("Button with URL image", FormImage.Type.URL, "https://github.com/GeyserMC.png?size=200") .button("Button with path image", FormImage.Type.PATH, "textures/i/glyph_world_template.png") ``` -------------------------------- ### Example Java API for Max Stack Size Source: https://geysermc.org/wiki/geyser/custom-items Demonstrates using the Geyser API builder to set the max stack size for a custom item. ```java .component(JavaItemDataComponents.MAX_STACK_SIZE, 16) ``` -------------------------------- ### Run Hydraulic Server Source: https://geysermc.org/wiki/other/hydraulic This Gradle command runs a server with Hydraulic installed. Ensure Geyser is also in your mods folder. ```bash ./gradlew :fabric:runServer ``` -------------------------------- ### Example Java API for Enchantment Glint Override Source: https://geysermc.org/wiki/geyser/custom-items Demonstrates using the Geyser API builder to set the enchantment glint override for a custom item. ```java .component(JavaItemDataComponents.ENCHANTMENT_GLINT_OVERRIDE, true) ``` -------------------------------- ### Example Main Class with Event Subscription Source: https://geysermc.org/wiki/geyser/extensions Demonstrates a main class for a Geyser extension that subscribes to the `GeyserPostInitializeEvent`. Use this event for most of your extension's logic as the GeyserAPI is fully available. ```java @Subscribe public void onPostInitialize(GeyserPostInitializeEvent event) { // example: show that your extension is loading. this.logger().info("Loading example extension..."); } ``` -------------------------------- ### Creating a Resource Pack from a File Path Source: https://geysermc.org/wiki/geyser/api Demonstrates how to create a resource pack object using a file path. This is useful for loading resource packs from the file system to be sent to players. ```java ResourcePack pack = ResourcePack.create(PackCodec.path(path)); ``` -------------------------------- ### Fabric Mod: Register Geyser Event Bus Source: https://geysermc.org/wiki/geyser/events Example of implementing ModInitializer and EventRegistrar in a Fabric mod to register the Geyser event bus. Registration is done within the server starting event to ensure Geyser API is loaded. ```java 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!"); } } ``` -------------------------------- ### Statistics Response Schema Example Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-stats-controller-get-all-stats-2 An example of the JSON response structure for the statistics endpoint. ```JSON { "pre_upload_queue": { "length": 0 }, "upload_queue": { "estimated_duration": 0, "length": 0 } } ``` -------------------------------- ### Get XUID from Gamertag Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-xbox-controller-get-xuid-v-2 This snippet shows the HTTP GET request to retrieve the XUID for a given gamertag. ```http GET ## https://api.geysermc.org/v2/xbox/xuid/:gamertag ``` -------------------------------- ### Install OpenJDK 21 on Termux Source: https://geysermc.org/wiki/geyser/setup/self/standalone Installs OpenJDK version 21, which is required to run Geyser Standalone on Android via Termux. ```bash pkg install openjdk-21 ``` -------------------------------- ### C# HttpClient Example for Raw Texture Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-render-controller-get-raw-texture Demonstrates how to fetch raw texture data using C# HttpClient. Replace ':texture_id' with the actual Java texture ID. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.geysermc.org/render/raw/:texture_id"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Example Custom Block JSON Mapping Source: https://geysermc.org/wiki/geyser/custom-blocks This JSON file demonstrates how to define a custom block, including its name, display name, geometry, material instances, and state overrides. It shows how to configure properties like destructibility, light emission, and placement filters. ```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" ] }] } } } } } } ``` -------------------------------- ### Resource Pack Creation Source: https://geysermc.org/wiki/geyser/api Demonstrates how to create a custom resource pack using the Geyser API, loading it from a file path. ```APIDOC ## Resource Pack Creation ### Description This section details how to create and manage resource packs within the Geyser API. You can define custom resource packs and send them to individual sessions or all sessions. ### Creating a Resource Pack from a File Path Use the `ResourcePack.create` method with a `PathPackCodec` to load a resource pack from a specified file path. ### Code Example ```java // Assuming 'path' is a Path object representing the resource pack directory ResourcePack pack = ResourcePack.create(PackCodec.path(path)); ``` ### Related Events - `SessionLoadResourcePacksEvent`: For sending resource packs to individual sessions before they log in. - `GeyserDefineResourcePacksEvent`: For sending resource packs to all sessions. ``` -------------------------------- ### Get Gamertag from XUID Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-xbox-controller-get-gamertag-v-2 This snippet shows how to make a GET request to the GeyserMC API to retrieve a gamertag associated with a given XUID. Ensure the XUID is a valid integer. ```http GET ## https://api.geysermc.org/v2/xbox/gamertag/:xuid ``` ```json { "gamertag": "Tim203" } ``` ```json { "message": "string" } ``` ```json { "message": "string" } ``` -------------------------------- ### Get All Stats Endpoint Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-stats-controller-get-all-stats The endpoint for retrieving all publicly available Global API statistics. ```HTTP GET ## https://api.geysermc.org/v1/stats ``` -------------------------------- ### C# HttpClient Example Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-xbox-controller-get-gamertag-v-2 Demonstrates how to use C#'s HttpClient to call the GeyserMC API for retrieving a gamertag. The response is read as a string. Ensure the 'Accept' header is set to 'application/json'. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://api.geysermc.org/v2/xbox/gamertag/:xuid"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Raw Texture Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-render-controller-get-raw-texture Fetches the raw texture data using the texture ID. ```APIDOC ## GET /render/raw/:texture_id ### Description Retrieves the raw texture data for a given texture ID. ### Method GET ### Endpoint https://api.geysermc.org/render/raw/:texture_id ### Parameters #### Path Parameters - **texture_id** (string) - Required - Java texture id ### Request Example ``` https://api.geysermc.org/render/raw/a90790c57e181ed13aded14c47ee2f7c8de3533e017ba957af7bdf9df1bde94f ``` ### Response #### Success Response (200) - **ok** - Description of the success response ``` -------------------------------- ### Get All Stats Endpoint Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-stats-controller-get-all-stats-2 The endpoint for retrieving all publicly available Global API statistics. ```HTTP GET ## https://api.geysermc.org/v2/stats ``` -------------------------------- ### Get Project Information Source: https://geysermc.org/wiki/api/downloads.geysermc.org/project Retrieves information about a specific GeyserMC project using its unique identifier. ```APIDOC ## GET /v2/projects/:project ### Description Gets information about a project. ### Method GET ### Endpoint https://download.geysermc.org/v2/projects/:project ### Parameters #### Path Parameters - **project** (string) - Required - The project identifier. Possible values: Value must match regular expression `[a-z]+`. ### Response #### Success Response (200) - **project_id** (string) - The project identifier. Possible values: Value must match regular expression `[a-z]+`. - **project_name** (string) - The name of the project. - **versions** (string[]) - An array of available project versions. #### Response Example ```json { "project_id": "geyser", "project_name": "Geyser", "versions": [ "string" ] } ``` ``` -------------------------------- ### Linux Startup Script for Geyser-Standalone Source: https://geysermc.org/wiki/geyser/creating-a-startup-script This shell script is for starting Geyser-Standalone on Linux. It navigates to the script's directory before running the Geyser jar. Ensure the script has execute permissions using 'chmod +x'. ```sh #!/bin/sh cd "$( dirname "$0" )" java -Xms1024M -jar Geyser-Standalone.jar ``` -------------------------------- ### Workaround for Firewall Issues (OVH/SoYouStart) Source: https://geysermc.org/wiki/geyser/fixing-unable-to-connect-to-world This workaround attempts to connect to the Bedrock IP and port through a web browser, then immediately tries connecting through Bedrock. It can resolve firewall issues on specific hosts like OVH/SoYouStart. ```bash http://test.geysermc.org:19132 ``` -------------------------------- ### Get Front Texture Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-render-controller-get-front-texture Fetches the front texture associated with a specific Java texture ID. ```APIDOC ## GET /render/front/:texture_id ### Description Retrieves the front texture for a given texture ID. ### Method GET ### Endpoint https://api.geysermc.org/render/front/:texture_id ### Parameters #### Path Parameters - **texture_id** (string) - Required - Java texture id ### Request Example ``` GET https://api.geysermc.org/render/front/a90790c57e181ed13aded14c47ee2f7c8de3533e017ba957af7bdf9df1bde94f ``` ### Response #### Success Response (200) - **ok** (object) - Description of the texture data (details not provided in source) #### Response Example (Response body details not provided in source) ``` -------------------------------- ### Download Specific File (C#) Source: https://geysermc.org/wiki/api/downloads.geysermc.org/download-specific Use HttpClient to send a GET request to download a specific file from a GeyserMC build. Ensure the response is successful before reading the content. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://download.geysermc.org/v2/projects/:project/versions/:version/builds/:build/downloads/:download"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Legacy Definition Example Source: https://geysermc.org/wiki/geyser/custom-items For custom items created before data components. Must specify a custom_model_data float value. ```json { "type": "legacy", "custom_model_data": 42, "bedrock_identifier": "example:example_item_legacy" } ``` -------------------------------- ### Bedrock Options API Example 2 Source: https://geysermc.org/wiki/geyser/custom-items Configures Bedrock options for a custom item using the Geyser API builder pattern, focusing on display handheld, creative category, group, and tags. ```java .bedrockOptions(CustomItemBedrockOptions.builder() .icon("example:my_sword") .displayHandheld(true) .creativeCategory(CreativeCategory.ITEMS) .creativeGroup("itemGroup.name.sword") .tag(Identifier.of("example:my_weapon")) ) ``` -------------------------------- ### Retrieve Version Information using HttpClient Source: https://geysermc.org/wiki/api/downloads.geysermc.org/version Demonstrates how to fetch version information from the Geyser Downloads API using C#'s HttpClient. ```csharp var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://download.geysermc.org/v2/projects/:project/versions/:version"); request.Headers.Add("Accept", "application/json"); var response = await client.SendAsync(request); response.EnsureSuccessStatusCode(); Console.WriteLine(await response.Content.ReadAsStringAsync()); ``` -------------------------------- ### Get Recent Uploads Source: https://geysermc.org/wiki/api/api.geysermc.org/global-api-web-api-skin-controller-get-recent-uploads Fetches a list of the most recently uploaded skins. The skins are ordered with the most recently uploaded first. ```APIDOC ## GET /v2/skin/bedrock/recent ### Description Retrieves a list of the most recently uploaded skins. The skins are ordered with the most recently uploaded first. ### Method GET ### Endpoint https://api.geysermc.org/v2/skin/bedrock/recent ### Parameters ### Request Body ### Request Example ### 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) - The amount of pages available. #### Response Example ```json { "data": [ { "id": 0, "texture_id": "string" } ], "total_pages": 0 } ``` #### Error Response (400) - **message** (string) - Required - The error message. #### Error Response Example ```json { "message": "string" } ``` ``` -------------------------------- ### Bedrock Options JSON Example 2 Source: https://geysermc.org/wiki/geyser/custom-items Configures Bedrock options for a custom item in JSON format, focusing on display handheld for weapons/tools, creative category, group, and tags. ```json "bedrock_options": { "icon": "example:my_sword", // must match shorthands defined in item_texture.json "display_handheld": true, // usually only set for weapons or tools "creative_category": "items", "creative_group": "itemGroup.name.sword", "tags": ["example:my_weapon"] } ``` -------------------------------- ### Example Java API for Removing a Component Source: https://geysermc.org/wiki/geyser/custom-items Demonstrates removing the food component from an item using the Geyser API builder. ```java @Subscribe public void onDefineCustomItems5(GeyserDefineCustomItemsEvent event) { event.register(Identifier.of("apple"), CustomItemDefinition.builder( Identifier.of("example:rotten_apple"), Identifier.of("example:rotten_apple") ) .displayName("Rotten apple") .removeComponent(JavaItemDataComponents.FOOD) .build()); } ``` -------------------------------- ### Definition Type Example Source: https://geysermc.org/wiki/geyser/custom-items A single custom item definition for a specific Java item model. Use for versions 1.21.4+. ```json { "type": "definition", "model": "example:example_model", "bedrock_identifier": "example:example_item" } ``` -------------------------------- ### Add Floodgate Player to Whitelist (Manual) Source: https://geysermc.org/wiki/geyser/faq Temporarily disable the whitelist, add the player, and then re-enable the whitelist. This method is useful for new players. ```text /whitelist off /whitelist add "." /whitelist on ``` -------------------------------- ### Send a Form using FloodgateApi Source: https://geysermc.org/wiki/geyser/forms Demonstrates sending a form to a Bedrock player using the FloodgateApi instance. This is a common method for initiating forms. ```java FloodgateApi.getInstance().sendForm(uuid, form); // or #sendForm(uuid, formBuilder) ```