Force Attack (Effect) — Skript

Addon: Skript · Category: Effect · Since: 2.5.1, 2.13 (multiple, amount)

Syntax

make %livingentities% attack %entities%

Description

Makes a living entity attack an entity with a melee attack. Using 'attack' will make the attacker use the item in their main hand and will apply extra data from the item, including enchantments and attributes. Using 'damage' with a number of hearts will not account for the item in the main hand and will always be the number provided.

Examples

spawn a wolf at location(0, 0, 0)
make last spawned wolf attack all players
spawn a zombie at location(0, 0, 0)
make player damage last spawned zombie by 2

View source