Damage Source - Direct Entity (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.12

Syntax

[the] direct entity [of %damagesources%]

Description

The direct entity of a damage source. The direct entity is the entity that directly caused the damage. (e.g. the arrow that was shot) Attributes of a damage source cannot be changed once created, only while within the 'custom damage source' section.

Examples

set {_source} to a custom damage source:
	set the damage type to magic
	set the causing entity to {_player}
	set the direct entity to {_arrow}
	set the damage location to location(0, 0, 10)
damage all players by 5 using {_source}
on death:
	set {_direct} to the direct entity of event-damage source

View source