* Begin testing i18n Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Add crowdin in-context demo for non-mdx Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Add crowdin-sync system Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Working sync system for translations Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Only build en locale for PRs Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Modify yarn install Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Do not immute cache Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Try with standard yarn install Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Revert to yarn --immutable Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Remove explicit url/file-loader resolutions Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Only log webpack errors Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Added MCServerHost to hosting providers (#47) * Added MCServerHost to hosting providers * Update providers.ts * Correct grammar and make instructions more concise --------- Co-authored-by: Kas-tle <26531652+Kas-tle@users.noreply.github.com> * Update supported Bedrock versions * Remove and Replace "TydiumCraft Skin API" (#53) * Update community-geyser-projects.md I no longer will run TydiumCraft Skin API. I have no interest in continuing it at this time (or anything minecraft related). However I have switched out the spot with an API that 100% is always updated and active. Hosted by my good friend Bret06. This works so much better as well. Thanks for everything over the years guys! Tydium out! * Update wiki/other/community-geyser-projects.md 👍 Co-authored-by: chris <github@onechris.mozmail.com> --------- Co-authored-by: chris <github@onechris.mozmail.com> * Update wording for creepernation api Update wording because it’s bothering me * Update GeyserExtras description (#52) * Update community-geyser-projects.md * Update wiki/other/community-geyser-projects.md Co-authored-by: chris <github@onechris.mozmail.com> --------- Co-authored-by: Luke <32024335+lukeeey@users.noreply.github.com> Co-authored-by: chris <github@onechris.mozmail.com> * Try matrix build strategy Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Fix matrix output Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Matrix goes to GITHUB_OUTPUT Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Fix deploy needs to combine Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Ensure correct commit is used if crowdin updates Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Make sure excluded content is respected Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Allow permission for commit action write Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Sync translations with Crowdin * Update index.md to make clear that this is for servers, not purely for clients (#57) * Update providers.ts (#58) * Update providers.ts VemoxHost added * Maintain alphabetized list --------- Co-authored-by: Kas-tle <26531652+Kas-tle@users.noreply.github.com> * Start on re-writing the providers page to provide more useful details to improve the setup guide * more work on this * Rework paper page for setup * Don't try and build paper setup as a full page * adjust not listed message * update mod/proxy pages * Initial setup i18n Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Add ability to hide proxy setup instructions by provider Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Temporary auto deployment; fix broken links Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Fix heading consistency Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Update language on provider instructions * Update language on new provider instructions * Upgrade actions/setup-node due to hang issue * Both * Forgot how many times we setup node... * Documentation for changes in API/2.6.2 (#62) * Document latest Geyser changes: - remote resource packs * Update/Finish pack docs * small typo fixes * Update page content * fix build * Update supported Bedrock version * Add Modrinth Servers to providers (#63) * Update supported versions & api version * Update versions.json to include 1.21.72 (#64) * Update bedrock version (#67) * Add 'we are not mojang' disclaimer to footer * Stop translations from overriding footer message Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Fix Standalone dump view (#68) * Add OrionNodes to providers (#69) * Update supported Bedrock versions in versions.json (1.21.81, 1.21.82) (#70) * Update faq.mdx to include recommended API (#73) Tydium skin API is abandoned, please direct users to a working API such as the one recommended by Tydium Derived from: https://github.com/GeyserMC/GeyserWebsite/commit/19ae50f95ddbfc24ff34a42d278bdc263e0200e6 * Update anticheat-compatibility.md (#74) * Update versions.json * Update versions.json (#75) * Remove LAC because it is no longer being maintained (#76) * Update versions.json for 1.21.7 (#77) * Update versions.json for 1.21.93 (#78) * Update versions.json for 1.21.94 (#79) * Update versions.json for Java 1.21.8 (#80) * Update Geyser Api version (#81) * Readd Hydraulic and add Rainbow, provide Item API V2 warning for Hydraulic (#82) * Fix incorrect Ubuntu on Oracle Cloud instructions (#84) * Remove Geyser Android App and Tempest (#83) * Update version.json for 1.21.100 (#88) * Update getting-started-with-the-api.md (#89) * Add and update wiki pages, add Thunder download. (#90) * Add a Thunder and Rainbow wiki page, touch up some other pages * Fix mobile sidebar * Address review 1/2 * Address review 1.5/2 (oops) * Address review 2/2 Co-authored-by: chris <github@onechris.mozmail.com> --------- Co-authored-by: chris <github@onechris.mozmail.com> * Indicate 1.21.101 on the Geyser Website (#93) * Added GeyserFloatingPoints to FAQ (#92) * Added GeyserFloatingPoints. * Update wiki/geyser/faq.mdx Co-authored-by: chris <github@onechris.mozmail.com> --------- Co-authored-by: chris <github@onechris.mozmail.com> * Update versions.json to indicate support for bedrock 1.21.111 * Update versions.json for Java 1.21.9/1.21.10 (#97) * Update versions.json for Java 1.21.9 * Update versions.json to include 1.21.10 * Update supported Bedrock version --------- Co-authored-by: Aurorawr <auroranova8756@gmail.com> Co-authored-by: chris <github@onechris.mozmail.com> * Update extensions file for new dependency system (#98) * Update extensions file for new dependency system * Update version * Update wiki/geyser/extensions.md --------- Co-authored-by: chris <github@onechris.mozmail.com> * Replace the Crowdin link with the current one (#101) * Replace the Crowdin link with the current one * Replace the link with the subdomain redirect * Update versions.json to include 1.21.114 (#102) * Update rainbow.md to indicate 1.21.9/.10 (#103) * Revise port forwarding instructions for Ubuntu Updated instructions for allowing Minecraft and Geyser through the OS firewall on Ubuntu. * Update providers and deploy action Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Sync translations with Crowdin * Correct providers syntax Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Use more templates wherever possible * Add build cache; update docusaurus-og Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Test deploy time with cache hit Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Use read-only cache for matrix build Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Unlikely we will use gh actions on arm... Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * This time cache will hit Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Hopefully correct yarn cache path... Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Maybe npm? Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Surely... Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * This time... Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Include yarn/docusaurus cache for PRs Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Add page IDs to more pages, fix broken pages * Update i18n pages * Sync translations with Crowdin * Add missing support pages and articles on providers, add Discord links * Add blog post on preparing Geyser servers for NetherNet Drafted with the help of Claude Opus 5.5. * Rewrite the hosted setup guide for NetherNet, add hosting page Provider entries now describe ports, signaling and install steps, grouped in the order the setup guide shows them. The guide generates the NetherNet config from them, and the old supported hosting providers list is replaced by a hosting page for Open Collaboration supporters. Drafted with the help of Claude Opus 5.5. * Rewrite the self-hosted setup guides for NetherNet The self-hosting pages now use the same steps and generated config as the hosted guide, and point out that the Geyser port needs both TCP and UDP. Drafted with the help of Claude Opus 5.5. * Add HTTPS for NetherNet page Covers serving built-in signaling over HTTPS, with a certificate in the Geyser config or with a reverse proxy (Caddy, nginx). Drafted with the help of Claude Opus 5.5. * Skip Crowdin sync in deploy workflow when no token is set Forks do not have the Crowdin secrets, so the sync step failed there and nothing got deployed. Without a token, the workflow now builds and deploys the pushed commit as is. Drafted with the help of Claude Opus 5.5. * Address: rtm's comments * Improve layout, drop confusing 26.40 note on setup guide * Cleanup blog post language / line breaks * Merge proxy server guides for server hosts, adjust exarotron provider entry, adjust setup guides to work with crowdin * Split the proxy setup guides back into Velocity and BungeeCord Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update hosting providers to upstream and collapse strings into defaults Port upstream's provider changes to the new format: add Minehost and ConsulHosting, update MCServerHost, rename Feather to Dawn and Modrinth Servers to Modrinth Hosting, merge RamShard into RackGenius, add MyArena, and drop hosts upstream removed. Restore link fixes the rewrite undid and install details dropped from the live page. Replace host-specific strings with templates or the generated steps where they say the same thing. Hosts that pick the port themselves show where it comes from instead of the config step. Hosts without NetherNet details that shared the Java server's port now ask for a new port, open for both TCP and UDP, and the generated config turns clone-remote-port off. Hosts that cannot give out a port fall back to the "Not listed" guide for the Java server's port, which uses Warden. BisectHosting no longer uses assumed example data. Entries keep the date of their last edit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove Dawn and date Aternos and exaroton today Dawn now integrates with Aternos, so it no longer needs its own entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove unused translation strings and fix the English GeyserConnect text Drop keys the code no longer uses from every locale: the old EmoteOffhand description ID, the theme's old unlisted content strings, strings removed on this branch, and the removed Custom Resource Packs sidebar category. The English GeyserConnect description had an outdated message that overrode the current one on the English site. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Hide the NetherNet and RakNet option when only the Java port is available With only the Java server's port there is no second UDP port for RakNet, so the "Not listed" Java port guide shows the NetherNet config without transport tabs. Drop the placeholder text that only applied there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Add an HTTPS step to the self-hosted guides and correct external signaling HTTPS claims Self-hosted guides end with a recommended step to serve signaling over HTTPS, since Geyser's built-in signaling uses plain HTTP by default and players get a "Trust on First Use?" prompt. External signaling services do not all provide HTTPS, so the blog post and HTTPS page now name Warden as one that does instead of implying all do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Update port forwarding guide, update OVH note * Sync translations with Crowdin * Hide entire placeholder strings and correcntly mark chrome json in crowdin Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Update actions and yarn Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Sync translations with Crowdin * Apply batched suggestions from code review Co-authored-by: Eclipse <eclipse@eclipseisoffline.xyz> * Fix NetherNet docs for the final Geyser PR - Built-in signaling serves HTTPS instead of HTTP once a certificate is configured (blog, system properties) - "Free port" is now "available port" in the blog - System properties: drop the removed "none" signaling mode, fix the signaling port default - playit.gg: note that the guide is for RakNet, and link playit.gg's NetherNet progress Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Build the setup guides from translation strings The per-platform setup pages are replaced by SetupGuide.tsx, which renders the hosted and self-hosted guides from shared MDXTranslatable strings, so Crowdin translates each sentence once instead of every page separately. Also: - "Not listed" with only the Java port sets mode: nxs instead of relying on Geyser's fallback - The playit.gg note links playit.gg's NetherNet progress instead of describing a setup - "free port" is now "available port" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Remove the trustedProxies.fetch system property for now Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Fix crowdin sync and don't translate trade names Signed-off-by: GitHub <noreply@github.com> * Sync translations with Crowdin * Fix build Signed-off-by: GitHub <noreply@github.com> * Sync translations with Crowdin * Address more concerns with nethernet https guide Signed-off-by: GitHub <noreply@github.com> * Fix signaling-trusted-proxies config in nethernet https article Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> * Remove port forwarding from the HTTPS guide Ports are already covered by the setup guide, and HTTPS does not change which ports need to be opened. Reverse proxies now use signaling-trusted-proxies, which reads X-Forwarded-For. * Remove placeholder hosts, hide the hosting page until it launches - Remove the placeholder hosts and their logos - Aternos and exaroton are bronze supporters: highlighted with a badge in the setup guide, without a "last updated" date, but not listed on the hosting page, which only shows gold and silver - Hide the hosting page and its links for now, and mention in the blog post that it is coming soon * Supporting hosts configure Geyser, they do not install it * Sync translations with Crowdin * Move nethernet https guide up on sidebar * Update to docusaurus 3.10 and fix all type errors Signed-off-by: GitHub <noreply@github.com> * HTTP and HTTPS do not both run at once * Link win-acme's and nginx's own Windows guides in the HTTPS guide * Fix crowdin key exclusion logic Signed-off-by: GitHub <noreply@github.com> * Sync translations with Crowdin * Address reviews, clear up instructions for users. Adds info on haproxy, NXS and MOTD forwarding * Note certificate permissions and where to save the Caddyfile * Sync translations with Crowdin * Document the geyser nethernet command * Sync translations with Crowdin * Support directly linking to the "not listed" or a specific hosts' guide * Mention warden supporting custom domains * Add HOSTING_PROVIDERS.md, update existing server host setup entries to reduce translation strings used * Sync translations with Crowdin --------- Signed-off-by: Joshua Castle <26531652+Kas-tle@users.noreply.github.com> Signed-off-by: GitHub <noreply@github.com> Co-authored-by: Yara Durand <87721861+Roolps@users.noreply.github.com> Co-authored-by: chris <github@onechris.mozmail.com> Co-authored-by: Tydium <67938521+Tydium@users.noreply.github.com> Co-authored-by: Creeperz653 <76449952+Creeperz653@users.noreply.github.com> Co-authored-by: LetsGoAway <68365423+letsgoawaydev@users.noreply.github.com> Co-authored-by: Luke <32024335+lukeeey@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Dan <20766261+D4n2021@users.noreply.github.com> Co-authored-by: santevemox <57247088+santevemox@users.noreply.github.com> Co-authored-by: rtm516 <ryantmilner@hotmail.co.uk> Co-authored-by: Emma Alexia <wafflecoffee7@gmail.com> Co-authored-by: Alex <zomka@fard.ing> Co-authored-by: Aurorawr <100384210+Novampr@users.noreply.github.com> Co-authored-by: Jens Collaert <63231928+Jens-Co@users.noreply.github.com> Co-authored-by: OrionNodes <ethan@orionnodes.com> Co-authored-by: SylentHuntress <91935048+sylenthuntress@users.noreply.github.com> Co-authored-by: oryxel <gamingnoob681@gmail.com> Co-authored-by: Eclipse <eclipse@eclipseisoffline.xyz> Co-authored-by: Nebojsa Majic <79749977+Onako2@users.noreply.github.com> Co-authored-by: qscbm187531 <1309635304@qq.com> Co-authored-by: Eveline Carter <6444703+drakon64@users.noreply.github.com> Co-authored-by: SleepyPop <81194303+SleepyPopp@users.noreply.github.com> Co-authored-by: Aurorawr <auroranova8756@gmail.com> Co-authored-by: rtm516 <rtm516@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
12 KiB
title, description, crowdin_page_id
| title | description | crowdin_page_id |
|---|---|---|
| Geyser Entity API | Geyser extensions can register custom Bedrock entity definitions, modify existing entities, and replace built-in types in entity spawning events. | b7d6246b-1821-48ee-9f97-a1f56f42efd7 |
:::warning Experimental API
The (Custom) Entity API was introduced with Geyser API 2.11.0 (26.2 update) and is currently marked @ApiStatus.Experimental. This means that the API may change or be rewritten in parts in a future version without prior deprecation.
If you have feedback on this API, encounter issues, or wish to request further features, please reach out to us!
The GeyserDefineEntityPropertiesEvent has been available since 2.9.0, but its identifier parameter changed in 2.11.0: it now takes a Bedrock entity identifier instead of a Java one. See Entity Properties for details.
:::
:::info This API currently cannot be used via JSON mappings. In the future, we are planning to support entity variants, which would likely also be usable through JSON mappings. :::
Custom entities currently (as of 26.2) do not exist in Minecraft: Java Edition. Instead, they can be simulated with armor stands holding item models, or item/block display entity combinations. Unlike Java Edition, Bedrock does support custom entity types, but does not have item or block display entities. With this API, Geyser extensions can register custom Bedrock entity definitions to use instead of Java entity types in entity spawning events to properly support custom entities for Bedrock players. Further, it allows modifying entity properties and data for any entity sent to a Bedrock player at runtime.
Additionally to registering custom entity definitions, you will also need to provide a resource pack to players defining custom entity textures and animations.
Prerequisites: Vocabulary
- Bedrock Entity Definition (
GeyserEntityDefinition/CustomEntityDefinition): Identifies the Bedrock entity type to spawn, either a built-in type, or a custom type - Entity Properties: Bedrock Molang-queryable values (
query.property(...)) registered per Bedrock entity type. See here for official documentation. - Entity Data Types: Properties on entities that can be changed dynamically, such as scale, size, hitboxes, and color.
Registering a Custom Entity Definition
Custom entity definitions are registered using GeyserDefineEntitiesEvent, which fires once during Geyser's startup:
@Subscribe
public void onDefineEntities(GeyserDefineEntitiesEvent event) {
CustomEntityDefinition myEntity = CustomEntityDefinition.of(Identifier.of("mynamespace:my_entity"));
event.register(myEntity);
}
Do note:
- Custom entity definition type identifier must not use the
minecraftnamespace - Entity types must have a unique identifier
Summoning custom entities
Whenever the Java server creates a new non-player entity for any connection, a ServerSpawnEntityEvent is fired. It can be used to change which Bedrock entity definition is sent to the Bedrock player or cancel the spawn entirely.
Each connection has its own entity cache, so different players will never share the same entity instance.
Example:
private static final Identifier ZOMBIE = Identifier.of("minecraft:zombie");
private static final CustomEntityDefinition MY_ENTITY = CustomEntityDefinition.of(Identifier.of("mynamespace:my_entity"));
@Subscribe
public void onDefineEntities(GeyserDefineEntitiesEvent event) {
event.register(MY_ENTITY);
}
@Subscribe
public void onSpawn(ServerSpawnEntityEvent event) {
if (event.entityType().is(ZOMBIE)) {
event.definition(MY_ENTITY); // definition must be registered beforehand
}
}
This example replaces all spawned zombies with our custom entity, which we registered in onDefineEntities.
:::info
The ServerSpawnEntityEvent fires before the entity is spawned (since it could be canceled). You can provide a consumer for the resulting GeyserEntity to set initial entity data values before the entity is spawned on the client:
private static final Identifier ZOMBIE = Identifier.of("minecraft:zombie");
private static final CustomEntityDefinition MY_ENTITY = CustomEntityDefinition.of(Identifier.of("mynamespace:my_entity"));
@Subscribe
public void onSpawn(ServerSpawnEntityEvent event) {
if (!event.entityType().is(ZOMBIE)) {
return;
}
event.definition(MY_ENTITY);
event.preSpawnConsumer(entity -> {
entity.override(GeyserEntityDataTypes.SCALE, 2.0f);
entity.override(GeyserEntityDataTypes.COLOR, (byte) 5);
});
}
:::
Modifying shoulder parrots
ServerAttachParrotsEvent fires when a parrot is attached to a player's shoulder. It extends ServerSpawnEntityEvent, so definition replacement, cancellation, and setting a pre spawn consumer for the
resulting GeyserEntity instance are all available.
@Subscribe
public void onParrotAttach(ServerAttachParrotsEvent event) {
event.definition(myParrotReplacement); // this entity definition would also be registered previously
}
Modifying entity data
Entity data consists of runtime-modifiable values such as scale, size, and hitboxes. All constants live in GeyserEntityDataTypes. Values for these types can be updated on a GeyserEntity
at any time using entity.override(type, value), or set inside a pre-spawn consumer in the entity spawn events to modify it before the spawn packet is sent.
Updating any of these values will override the value sent by the server until the override is removed. To remove an override, a null value can be used.
| Constant | Value Type | Description |
|---|---|---|
COLOR |
Byte |
Bedrock color component (0–15) |
VARIANT |
Integer |
Numeric variant index, queryable via query.variant in resource packs |
WIDTH |
Float |
Collision box width |
HEIGHT |
Float |
Collision box height |
VERTICAL_OFFSET |
Float |
Y-axis offset applied on top of the Java entity position |
SCALE |
Float |
Visual scale multiplier |
HITBOXES |
List<Hitbox> |
Custom hitboxes. Set an empty list to remove all hitboxes |
SEAT_OFFSET |
Vector3f |
Riding position offset |
ROTATION_LOCKED_TO_VEHICLE |
Boolean |
Whether the rider's rotation is locked to the vehicle's rotation |
SEAT_LOCK_RIDER_ROTATION_DEGREES |
Float |
The degrees of rotation a rider may rotate within when mounted on an entity. |
SEAT_HAS_ROTATION |
Boolean |
Whether a seat has rotation |
ROTATE_RIDER_DEGREES |
Float |
Rotation offset for the seat in degrees |
:::info
Hitbox min, max and pivot are absolute world coordinates, not relative to the entity's position.
:::
Entity Properties
Entity properties expose Java-side state to Bedrock resource packs via query.property('namespace:name') in Molang. Entity properties can be registered for both custom, and vanilla entity types using the GeyserDefineEntityPropertiesEvent, which fires during Geyser startup.
:::warning Breaking Change in 2.11.0
GeyserDefineEntityPropertiesEvent has been available since 2.9.0, but its first parameter changed in 2.11.0: it now takes a Bedrock entity type identifier.
:::
A maximum of 32 properties per entity type can be registered.
private GeyserFloatEntityProperty aggression = null;
private GeyserIntEntityProperty state = null;
private GeyserBooleanEntityProperty enraged = null;
private GeyserEnumEntityProperty<Phase> phase = null;
private GeyserStringEnumProperty mode = null;
@Subscribe
public void onDefineProperties(GeyserDefineEntityPropertiesEvent event) {
Identifier zombieType = Identifier.of("minecraft:zombie");
// Float property: min, max, default (null default uses min)
aggression = event.registerFloatProperty(zombieType, Identifier.of("mynamespace:aggression"), 0f, 1f, 0f);
// Integer property
state = event.registerIntegerProperty(zombieType, Identifier.of("mynamespace:state"), 0, 10, null);
// Boolean property
enraged = event.registerBooleanProperty(zombieType, Identifier.of("mynamespace:enraged"), false);
// Enum from a Java enum class (max 16 values, names max 32 chars, must start with a letter)
phase = event.registerEnumProperty(zombieType, Identifier.of("mynamespace:phase"), Phase.class, Phase.IDLE);
// Enum from a string list
mode = event.registerEnumProperty(zombieType, Identifier.of("mynamespace:mode"), List.of("idle", "active", "fleeing"), "idle");
}
Properties can be updated on a GeyserEntity instance at any time:
// Single property
entity.updateProperty(aggression, 0.5f);
Looking up entities
After an entity has spawned it can be looked up through GeyserConnection#entities(). All lookup methods are thread-safe.
EntityData entityData = connection.entities();
// By Java entity ID (int)
GeyserEntity entity = entityData.byJavaId(javaId);
// By UUID
GeyserEntity entity = entityData.byUuid(uuid);
// By Geyser/Bedrock runtime ID (long)
GeyserEntity entity = entityData.byGeyserId(geyserId);
All three return null if no entity is found. A GeyserEntity exposes various properties, such as the entity uuid, current passengers / vehicle if applicable, and it can further be used to update
entity properties or entity data type values.
Full Example
Expand for a full extension example
public class MyExtension implements Extension {
// Create a custom entity definition
private final CustomEntityDefinition enhancedZombie = CustomEntityDefinition.of(Identifier.of("myext:enhanced_zombie"));
private GeyserFloatEntityProperty healthFraction = null;
// Register the custom entity type
@Subscribe
public void onDefineEntities(GeyserDefineEntitiesEvent event) {
event.register(enhancedZombie);
}
// Optionally: Register entity properties (Bedrock identifier)
@Subscribe
public void onDefineProperties(GeyserDefineEntityPropertiesEvent event) {
healthFraction = event.registerFloatProperty(
enhancedZombie.identifier(),
Identifier.of("myext:health_fraction"),
0f, 1f, 1f
);
}
// Replace a default Bedrock entity definition with our custom one
@Subscribe
public void onSpawn(ServerSpawnEntityEvent event) {
// Unless you want to replace everything, you should probably add checks for e.g., entity type, or entity UUID
event.definition(enhancedZombie);
event.preSpawnConsumer(entity -> {
entity.override(GeyserEntityDataTypes.SCALE, 1.5f);
entity.override(GeyserEntityDataTypes.COLOR, (byte) 4);
});
}
}