Damage Source - Causing Entity (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.12

Syntax

[the] (causing|responsible) entity [of %damagesources%]

Description

The causing entity of a damage source. The causing entity is the entity that ultimately caused the damage. (e.g. the entity that shot an arrow) When setting a 'causing entity' you must also set a 'direct entity'. 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)
on damage:
	set {_causing} to the causing entity of event-damage source

View source