Skip to content

MountSystems.OnMinecartHit

Package: com.hypixel.hytale.builtin.mounts

public static class OnMinecartHit extends DamageEventSystem

Handles 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.

ConstantValueDescription
HIT_RESET_TIMEDuration.ofSeconds(10)Time after which the hit counter resets.
NUMBER_OF_HITS3Hits required to destroy the minecart.

Matches entities with both MinecartComponent and TransformComponent.

Ordered AFTER DamageModule.getGatherDamageGroup() and DamageModule.getFilterDamageGroup(), and BEFORE DamageModule.getInspectDamageGroup().

On each damage event:

  1. If the last hit was more than 10 seconds ago, resets the hit counter and timestamp.
  2. If damage amount is positive, increments the hit counter and records the timestamp.
  3. On the 3rd hit, removes the minecart entity.
  4. 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.
Hydex is an independent community resource. Hytale is a trademark of Hypixel Studios. Hydex is not affiliated with or endorsed by Hypixel Studios.