Entity
paper/is_player
Is Player
Checks whether an entity is a player and extracts the Player reference if so.
Note: Use this after receiving an entity output that might be a player (e.g. the killer output of Entity Death Trigger or Player Death Trigger). Connect isPlayer to a Branch node before using the player output to avoid null errors.
Inputs
| Name | Type | Optional | Description |
|---|---|---|---|
entity |
entity | The entity to check. |
Outputs
| Name | Type | Description |
|---|---|---|
isPlayer |
boolean | True if the entity is a player. |
player |
player | The entity cast to a Player (null if not a player). |
Examples
Reward player killers only
Give a reward only when the killer of an entity is a player, not another mob.
- Entity Death Trigger → killer → Is Player (entity)
- Is Player → isPlayer → Branch
- Branch (true) → Player Give Item (use Is Player → player as the player input)