> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://documentation.celestory.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# 🟦 Decrement

# 🟦 Decrement

![Decrement](https://celestory-docs-illustrations.netlify.app/en/Decrement_EN.svg)

The Decrement block allows you to subtract a precise value from a Number type variable, providing a convenient shortcut for operations like removing life points, decreasing a counter or adjusting a balance without manual calculation.

This block simplifies arithmetic operations by automating subtraction (variable = variable - value), thus avoiding errors and speeding up flow design.

## 📥 Entries

- variable (Number): The targeted numeric variable, previously defined in the project.
- value (Number): The number to subtract from the variable (default: 1).

## 📤 Outings

- out (Stream): The output flow that activates after the decrement is successful.

## 💡 Example of use

Scenario: Management of life points in a game

1. The player takes damage after an enemy attack.
1. The system checks that the life points (player_pv) are greater than 0.
1. The Decrement block is called with:

- variable = player_pv (current value: 30).
- value = 5 (damage inflicted).

1. The player_pv variable changes to 25.
1. The output stream (out) triggers a check to display a message ("Damage taken!") or activate a visual effect.

## ⚙️ Technical Details

- Behavior: The decrement is immediate and directly modifies the target variable. No type validation is performed (make sure variable is of type Number).
- Default value: If value is not specified, the subtraction is 1.

---

*Documented version: v1*
