[PR #5409] [MERGED] Native mods: native_spawn_falling_block throws a block from a server mod #6267

Closed
opened 2026-11-03 06:16:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5409
Author: @Vaspyyy
Created: 10/31/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: feat/native-falling-blocks


📝 Commits (5)

  • de92159 Native mods: native_spawn_falling_block throws a block from a server mod
  • 1ec53c7 Merge remote-tracking branch 'upstream/main' into feat/native-falling-blocks
  • a844d55 Merge main into #5409
  • a8b7cdc Merge remote-tracking branch 'upstream/main' into feat/native-falling-blocks
  • 59d8117 Merge main into #5409

📊 Changes

4 files changed (+153 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
➕ crates/horizon-client/src/game/native_falling.rs (+130 -0)
📝 docs/native-mods.md (+14 -0)
➕ tools/native-hook-fragments/native_falling_block.json (+8 -0)

📄 Description

Requested by Ransom · project thread

🤖 Opened by Vaspyyy's AI agent (Claude Code, Claude Opus 5.5), not by Vaspyyy personally.

What and why

native_spawn_falling_block(dimension, state, pos, velocity, falling) throws a falling block at a velocity (blocks a tick, each axis cut to 3.9, the network's limit). It flies, lands and places itself as sand does, or drops as an item where it can't be placed. NativeFalling holds drop_item (default true) and hurts (anvil-style damage: 2 a block fallen, 40 at most).

The block at pos is left alone; a mod takes it away with native_set_block first to make a block fall out of the world, as explosion debris or a collapsing structure would. Refused on a client, for another dimension, air or an unknown state, an unloaded chunk, values that aren't finite, or with 1024 falling blocks in the level already.

Kind

  • feature: something new for players (listed under New in the release notes)

Vanilla reference

FallingBlockEntity (fall, setDeltaMovement, dropItem, setHurtsEntities(2.0F, 40)); the entity is the same FallingBlock gravity blocks use, so landing and dropping follow the existing code.

Other projects' code

none

Self-check

Run from the fork against upstream/main (d30588e), Rust 1.97:

cargo fmt -p horizon-client: clean
cargo test -p horizon-client --bin horizon-client native_falling: pass
cargo clippy -p horizon-client --bins --tests -- -D warnings -A clippy::manual_range_contains: pass
  (the allow is for horizon-world/src/worldgen/aquifer/noise_based.rs:476, a lint new in Rust 1.97 that fails on main too)

All six artillery hook branches (explode, camera shake, falling blocks, entities, shader values, local sounds) were also merged together with tools/stamp_native_hooks.py run locally (not committed) and their tests run there.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XnU6QSxLfzUbudHhcvZtgy


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5409 **Author:** [@Vaspyyy](https://github.com/Vaspyyy) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/native-falling-blocks` --- ### 📝 Commits (5) - [`de92159`](https://github.com/horizon-rust/horizon/commit/de92159b98dfbb9ba0c4fc7317c75d49190a8019) Native mods: native_spawn_falling_block throws a block from a server mod - [`1ec53c7`](https://github.com/horizon-rust/horizon/commit/1ec53c7a3f2009cdc8739dfb2d56436ea0e4b868) Merge remote-tracking branch 'upstream/main' into feat/native-falling-blocks - [`a844d55`](https://github.com/horizon-rust/horizon/commit/a844d558153f562ee61afe38fffb31005c11e319) Merge main into #5409 - [`a8b7cdc`](https://github.com/horizon-rust/horizon/commit/a8b7cdc12e9b0d08244dc8fa1112ab0cd3e48685) Merge remote-tracking branch 'upstream/main' into feat/native-falling-blocks - [`59d8117`](https://github.com/horizon-rust/horizon/commit/59d8117f64c277bd1e7884ae5f0a83a17870b82a) Merge main into #5409 ### 📊 Changes **4 files changed** (+153 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) ➕ `crates/horizon-client/src/game/native_falling.rs` (+130 -0) 📝 `docs/native-mods.md` (+14 -0) ➕ `tools/native-hook-fragments/native_falling_block.json` (+8 -0) </details> ### 📄 Description <!-- claude-projects-attribution: {"github_login":"Vaspyyy"} --> _Requested by **Ransom** · [project thread](https://claude.ai/code/project/chan_014LE6qsPXZ5YJ26HjaADSTZ?thread=cmsg_014LE6qsPXZ5YJ26HjaADSTZ1T4cmgL2QQ21WRYQVKMdRd)_ > 🤖 Opened by Vaspyyy's AI agent (Claude Code, Claude Opus 5.5), not by Vaspyyy personally. ## What and why `native_spawn_falling_block(dimension, state, pos, velocity, falling)` throws a falling block at a velocity (blocks a tick, each axis cut to 3.9, the network's limit). It flies, lands and places itself as sand does, or drops as an item where it can't be placed. `NativeFalling` holds `drop_item` (default true) and `hurts` (anvil-style damage: 2 a block fallen, 40 at most). The block at `pos` is left alone; a mod takes it away with `native_set_block` first to make a block fall out of the world, as explosion debris or a collapsing structure would. Refused on a client, for another dimension, air or an unknown state, an unloaded chunk, values that aren't finite, or with 1024 falling blocks in the level already. ## Kind - [x] feature: something new for players (listed under New in the release notes) ## Vanilla reference `FallingBlockEntity` (`fall`, `setDeltaMovement`, `dropItem`, `setHurtsEntities(2.0F, 40)`); the entity is the same `FallingBlock` gravity blocks use, so landing and dropping follow the existing code. ## Other projects' code none ## Self-check Run from the fork against `upstream/main` (d30588e), Rust 1.97: ``` cargo fmt -p horizon-client: clean cargo test -p horizon-client --bin horizon-client native_falling: pass cargo clippy -p horizon-client --bins --tests -- -D warnings -A clippy::manual_range_contains: pass (the allow is for horizon-world/src/worldgen/aquifer/noise_based.rs:476, a lint new in Rust 1.97 that fails on main too) ``` All six artillery hook branches (explode, camera shake, falling blocks, entities, shader values, local sounds) were also merged together with `tools/stamp_native_hooks.py` run locally (not committed) and their tests run there. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01XnU6QSxLfzUbudHhcvZtgy --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:16:53 +07:00
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#6267
No description provided.