# EntityAttack

TIP

  • entityAttack(<entity_ID>, <player>, <damage>, [knockback])
  • This function allows you to let an entity attack a player with the option to modify the knockback that'll be done to the player.
  • Note: The entity must be loaded in order to attack the player.

# Parameters

  • <entity_ID> The entity ID as int
  • <player> The player to attack as string
  • <damage> The damage to deal to the player as int or float
  • [knockback] The amount of knockback that the player will get as int or float [Default: 0.4]

# Example

1: $id$ = spawnEntity("MagmaCube", $world$, $x$, $y$, $z$)
2: entityAttack($id$, $player$, 5, 0.8)