MountSystems.OnMinecartHit
Package: com.hypixel.hytale.builtin.mounts
public static class OnMinecartHit extends DamageEventSystemHandles damage to minecart entities. After 3 hits, the minecart is destroyed. If 10 seconds pass since the last hit without further damage, the hit counter resets.
Constants
Section titled “Constants”| Constant | Value | Description |
|---|---|---|
HIT_RESET_TIME | Duration.ofSeconds(10) | Time after which the hit counter resets. |
NUMBER_OF_HITS | 3 | Hits required to destroy the minecart. |
Matches entities with both MinecartComponent and TransformComponent.
Dependencies
Section titled “Dependencies”Ordered AFTER DamageModule.getGatherDamageGroup() and DamageModule.getFilterDamageGroup(), and BEFORE DamageModule.getInspectDamageGroup().
Behavior
Section titled “Behavior”On each damage event:
- If the last hit was more than 10 seconds ago, resets the hit counter and timestamp.
- If damage amount is positive, increments the hit counter and records the timestamp.
- On the 3rd hit, removes the minecart entity.
- If the damage source is a player in non-Creative mode and the minecart has a source item, drops an item entity at the minecart’s position.
Related Types
Section titled “Related Types”- MountSystems — enclosing class
- MinecartComponent — the component tracking hit state
- MountSystems.EnsureMinecartComponents — ensures supporting components
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.