[GH-ISSUE #5482] Native mods: a mod's own particle types, beside vanilla's #1691

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

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

Originally assigned to: @CocofireHD on GitHub.

Part of #4953 ("mod particle types and sound events"), the particle half (sound events are #5469)

Mods can spawn particles today, but only vanilla's: native_send_particles (#4390) takes minecraft: particle types
A mod can't register its own particle type, so a mod's smoke, steam or sparks have to borrow a vanilla one

What's missing

  • a mod declaring its own particle types (the vanilla particle registry, as NeoForge's registration does)
  • the client drawing them from the mod's particles/<name>.json and textures, as vanilla's particle providers do (RegisterParticleProvidersEvent)
  • native_send_particles taking the mod's own types, synced to clients like vanilla ones
Originally created by @reservedbytes on GitHub (Oct 31, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/5482 Originally assigned to: @CocofireHD on GitHub. Part of #4953 ("mod particle types and sound events"), the particle half (sound events are #5469) Mods can spawn particles today, but only vanilla's: `native_send_particles` (#4390) takes `minecraft:` particle types A mod can't register its own particle type, so a mod's smoke, steam or sparks have to borrow a vanilla one What's missing - a mod declaring its own particle types (the vanilla particle registry, as NeoForge's registration does) - the client drawing them from the mod's `particles/<name>.json` and textures, as vanilla's particle providers do (`RegisterParticleProvidersEvent`) - `native_send_particles` taking the mod's own types, synced to clients like vanilla ones
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:6548947895 --> @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

@CocofireHD commented on GitHub (Nov 1, 2026):

🤖 Agent: pull request open — #5792.

What it does: a native mod sends its own type with ParticleOptions::named("mymod:spark") through the existing native_send_particles (no hook moved, NATIVE_HOOKS_API is 81 for the new capability). The client draws it as vanilla's SimpleParticleType with a sprite set read from the mod's assets/<namespace>/particles/<name>.json, textures as particle/<texture>; a pack without the file draws nothing for that name.

The wire has one Horizon-only field: MOD_PARTICLE_ID = -1 plus the namespaced string, because vanilla's particle ids are registry ids a client without the mod cannot resolve. It is documented where it is defined, and a client that does not know the type ignores it like any unknown particle.

Tests: the sprite-set load and the named spawn (particles::tests::a_mod_particles_json_becomes_its_sprite_set) and the codec round trip with the sentinel (entity_data::tests::particles_round_trip). clippy clean on the three crates.

<!-- gh-comment-id:6555184917 --> @CocofireHD commented on GitHub (Nov 1, 2026): 🤖 Agent: pull request open — #5792. What it does: a native mod sends its own type with `ParticleOptions::named("mymod:spark")` through the existing `native_send_particles` (no hook moved, `NATIVE_HOOKS_API` is 81 for the new capability). The client draws it as vanilla's `SimpleParticleType` with a sprite set read from the mod's `assets/<namespace>/particles/<name>.json`, textures as `particle/<texture>`; a pack without the file draws nothing for that name. The wire has one Horizon-only field: `MOD_PARTICLE_ID = -1` plus the namespaced string, because vanilla's particle ids are registry ids a client without the mod cannot resolve. It is documented where it is defined, and a client that does not know the type ignores it like any unknown particle. Tests: the sprite-set load and the named spawn (`particles::tests::a_mod_particles_json_becomes_its_sprite_set`) and the codec round trip with the sentinel (`entity_data::tests::particles_round_trip`). clippy clean on the three crates.
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#1691
No description provided.