Damage Source (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.12

Syntax

[a] custom damage source [(with|using) [the|a] [damage type [of]] %-damagetype%]

Description

Create a custom damage source and change the attributes. 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)
damage all players by 5 using {_source}
on damage:
	if the damage type of event-damage source is magic:
		set the damage to damage * 2

View source