[PR #2198] [MERGED] Cactus destroys dropped items that touch it #4097

Closed
opened 2026-11-03 04:14:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2198
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/26/2026
Merged by: @ludovic111

Base: main ← Head: fix/cactus-destroys-items


📝 Commits (1)

  • 54fe738 Cactus destroys dropped items that touch it

📊 Changes

3 files changed (+62 additions, -0 deletions)

View changed files

📝 crates/horizon-client/src/entities.rs (+9 -0)
📝 crates/horizon-client/src/items.rs (+30 -0)
📝 crates/horizon-client/src/motion/environment.rs (+23 -0)

📄 Description

What and why

A dropped item lying against a cactus was never harmed. In vanilla the cactus destroys it within a few ticks.

Item entities now take 1 damage per tick while their box touches a cactus. They have 5 health, so the item is gone after 5 ticks. Fire-resistant items (netherite gear) are not spared, because the cactus is not fire damage. Only a stack whose damage_resistant component names the cactus damage type (directly or through a tag that lists it) ignores it.

Vanilla reference

  • CactusBlock.entityInside: entity.hurt(damageSources().cactus(), 1.0F).
  • ItemEntity starts with 5 health (DEFAULT_HEALTH); ItemEntity.hurtServer subtracts the damage and discards the entity at health <= 0.
  • Items have no hurt cooldown, so the damage lands every tick.
  • ItemStack.canBeHurtBy is the only exemption, through the damage_resistant component.
  • Entity.checkInsideBlocks tests the box deflated by 1.0E-5 against the block's inside shape, which for the cactus is the whole block. Contact is checked on the item's box after its move, the same simplification the item fire check already uses.

Self-check

cargo check -p horizon-client passes.


🔄 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/2198 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/26/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/cactus-destroys-items` --- ### 📝 Commits (1) - [`54fe738`](https://github.com/horizon-rust/horizon/commit/54fe73854e38f8bd16cee43f840ddd9d34ce40f1) Cactus destroys dropped items that touch it ### 📊 Changes **3 files changed** (+62 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entities.rs` (+9 -0) 📝 `crates/horizon-client/src/items.rs` (+30 -0) 📝 `crates/horizon-client/src/motion/environment.rs` (+23 -0) </details> ### 📄 Description ## What and why A dropped item lying against a cactus was never harmed. In vanilla the cactus destroys it within a few ticks. Item entities now take 1 damage per tick while their box touches a cactus. They have 5 health, so the item is gone after 5 ticks. Fire-resistant items (netherite gear) are not spared, because the cactus is not fire damage. Only a stack whose `damage_resistant` component names the cactus damage type (directly or through a tag that lists it) ignores it. ## Vanilla reference - `CactusBlock.entityInside`: `entity.hurt(damageSources().cactus(), 1.0F)`. - `ItemEntity` starts with 5 health (`DEFAULT_HEALTH`); `ItemEntity.hurtServer` subtracts the damage and discards the entity at `health <= 0`. - Items have no hurt cooldown, so the damage lands every tick. - `ItemStack.canBeHurtBy` is the only exemption, through the `damage_resistant` component. - `Entity.checkInsideBlocks` tests the box deflated by `1.0E-5` against the block's inside shape, which for the cactus is the whole block. Contact is checked on the item's box after its move, the same simplification the item fire check already uses. ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:14:39 +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#4097
No description provided.