[GH-ISSUE #5483] Native mods: mod particle types (RegisterParticleProvidersEvent) #1694

Closed
opened 2026-11-02 15:48:59 +07:00 by bsakaguchi · 6 comments
Owner

Originally created by @PzmuV1517 on GitHub (Oct 31, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5483

Originally assigned to: @CocofireHD on GitHub.

Part of #4953: "Mod particle types and sound events". Sound events landed in #5469; this is the particle half.

Today

  • native_send_particles takes ParticleOptions, whose type is ParticleType: a closed enum of vanilla's types (crates/horizon-client-core/src/particle_type.rs). A mod can only play vanilla particles.
  • Particles go to players by their id in the built-in minecraft:particle_type registry (game/lan_particles.rs, lan/hub.rs), as vanilla's ClientboundLevelParticlesPacket does.
  • The client loads sprite sets from assets/minecraft/particles/<name>.json for vanilla's types only (particles.rs, load_sprites).

Sounds could travel by name (#5469) because vanilla sends an unregistered sound event as a direct holder. Particles have no such form: the packet carries a registry id, so a mod's type needs an id the server and the client agree on.

What it needs

Named after NeoForge's public API (DeferredRegister on Registries.PARTICLE_TYPE, SimpleParticleType, RegisterParticleProvidersEvent):

  1. Registration. A mod declares its particle types (mymod:spark), with SimpleParticleType's overrideLimiter flag.
  2. Ids. Mod types are appended after vanilla's in minecraft:particle_type, in the same order on the server and the client, and the client learns them when it joins (as NeoForge syncs modded registries during configuration). Vanilla's ids don't move.
  3. Client. Sprite sets from assets/<namespace>/particles/<path>.json, as vanilla reads its own, and a provider for each type: a default sprite particle, or the mod's own through a client hook (RegisterParticleProvidersEvent's sprite set, single sprite and special providers).
  4. Sending. native_send_particles accepts a mod type; a helper fragment in tools/native-hook-fragments/.

Particle options with mod-defined data (a custom ParticleOptions codec) can follow in a second PR.

Testing

In the real game on the server thread and on a dedicated server, with a small mod (the horizon-machine-sample or a test mod) that registers a type, ships its sprite JSON and texture, and sends it from a block tick.

Originally created by @PzmuV1517 on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5483 Originally assigned to: @CocofireHD on GitHub. Part of #4953: "Mod particle types and sound events". Sound events landed in #5469; this is the particle half. ## Today - `native_send_particles` takes `ParticleOptions`, whose type is `ParticleType`: a closed enum of vanilla's types (`crates/horizon-client-core/src/particle_type.rs`). A mod can only play vanilla particles. - Particles go to players by their id in the built-in `minecraft:particle_type` registry (`game/lan_particles.rs`, `lan/hub.rs`), as vanilla's `ClientboundLevelParticlesPacket` does. - The client loads sprite sets from `assets/minecraft/particles/<name>.json` for vanilla's types only (`particles.rs`, `load_sprites`). Sounds could travel by name (#5469) because vanilla sends an unregistered sound event as a direct holder. Particles have no such form: the packet carries a registry id, so a mod's type needs an id the server and the client agree on. ## What it needs Named after NeoForge's public API (`DeferredRegister` on `Registries.PARTICLE_TYPE`, `SimpleParticleType`, `RegisterParticleProvidersEvent`): 1. **Registration.** A mod declares its particle types (`mymod:spark`), with `SimpleParticleType`'s `overrideLimiter` flag. 2. **Ids.** Mod types are appended after vanilla's in `minecraft:particle_type`, in the same order on the server and the client, and the client learns them when it joins (as NeoForge syncs modded registries during configuration). Vanilla's ids don't move. 3. **Client.** Sprite sets from `assets/<namespace>/particles/<path>.json`, as vanilla reads its own, and a provider for each type: a default sprite particle, or the mod's own through a client hook (`RegisterParticleProvidersEvent`'s sprite set, single sprite and special providers). 4. **Sending.** `native_send_particles` accepts a mod type; a helper fragment in `tools/native-hook-fragments/`. Particle options with mod-defined data (a custom `ParticleOptions` codec) can follow in a second PR. ## Testing In the real game on the server thread and on a dedicated server, with a small mod (the [horizon-machine-sample](https://github.com/arismoko/horizon-machine-sample) or a test mod) that registers a type, ships its sprite JSON and texture, and sends it from a block tick.
Author
Owner

@CocofireHD commented on GitHub (Oct 31, 2026):

🤖 Agent: /claim

Claiming to work on this. I will open a pull request with the fix and keep this issue updated.

<!-- gh-comment-id:6548951931 --> @CocofireHD commented on GitHub (Oct 31, 2026): 🤖 Agent: /claim Claiming to work on this. I will open a pull request with the fix and keep this issue updated.
Author
Owner

@PzmuV1517 commented on GitHub (Oct 31, 2026):

Duplicate of #5482, opened a few minutes earlier.

<!-- gh-comment-id:6548954341 --> @PzmuV1517 commented on GitHub (Oct 31, 2026): Duplicate of #5482, opened a few minutes earlier.
Author
Owner

@CocofireHD commented on GitHub (Oct 31, 2026):

🤖 Agent: /unclaim — duplicate of #5482, which stays with me. Releasing so nobody is blocked on this one.

<!-- gh-comment-id:6548979114 --> @CocofireHD commented on GitHub (Oct 31, 2026): 🤖 Agent: /unclaim — duplicate of #5482, which stays with me. Releasing so nobody is blocked on this one.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 31, 2026):

🤖 Claims: refused, duplicate of #5482 which stays with me. Releasing so nobody isn't understood here. Use /claim or /unclaim (the trusted reviewers: /unclaim @login). (asked by @CocofireHD)

<!-- gh-comment-id:6548981224 --> @github-actions[bot] commented on GitHub (Oct 31, 2026): 🤖 Claims: refused, `duplicate of #5482 which stays with me. Releasing so nobody` isn't understood here. Use `/claim` or `/unclaim` (the trusted reviewers: `/unclaim @login`). (asked by @CocofireHD)
Author
Owner

@CocofireHD commented on GitHub (Oct 31, 2026):

🤖 Agent: /unclaim

<!-- gh-comment-id:6549073427 --> @CocofireHD commented on GitHub (Oct 31, 2026): 🤖 Agent: /unclaim
Author
Owner

@github-actions[bot] commented on GitHub (Oct 31, 2026):

🤖 Claims: refused, This issue is closed. (asked by @CocofireHD)

<!-- gh-comment-id:6549080262 --> @github-actions[bot] commented on GitHub (Oct 31, 2026): 🤖 Claims: refused, This issue is closed. (asked by @CocofireHD)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#1694
No description provided.