Skip to content
mouse114514 edited this page Sep 12, 2026 · 1 revision

When Hurt

When Hurt

Overview

Triggers whenever the player takes damage. Note: by the time this fires, the damage is already applied and health has been reduced - this event cannot prevent the original damage. Use it for follow-up effects.

This is a hat block: it must be placed at the top of a script.

Slots

This block has no parameter slots.

Connections

Connection Type Description
Top - hat block, cannot connect
Bottom Statement connected blocks run when the player is hurt

Typical Uses

  • Add stress, pain or bleeding after taking a hit
  • Auto-shout or play a sound when hurt
  • React in different tiers based on the remaining health

Notes

  • Fires after the damage has been applied
  • Reading "player health" gives the already-reduced value
  • Cannot block or mitigate damage; handle damage reduction at the source instead

Example

when hurt
├── play sound "hit"
├── set stress to player stress + 10
└── if player health < 30 then
    └── talk "I need medical attention!"

Generated Code

Emits the patch marker //PATCH:OnHurt, injected into the OnHurt() method.

Block ID: cu_when_hurt


中文 | Event Blocks | Block Reference

Clone this wiki locally