On Portal (Event) — Skript

Addon: Skript · Category: Event · Since: 1.0, 2.5.3 (entities), 2.13 (location changers)

Syntax

[on] [player] portal

Description

Called when a player or an entity uses a nether or end portal. Note that 'on entity portal' event does not apply to players. <a href='#EffCancelEvent'>Cancel the event</a> to prevent the entity from teleporting.

Event Values

  • event-block
  • event-chunk
  • event-commandsender
  • event-entity
  • event-entitydata
  • event-location
  • event-player
  • event-teleportcause
  • event-world
  • past event-chunk
  • past event-location

Examples

on portal:
	broadcast "%player% has entered a portal!"
on player portal:
	player's world is world("wilderness")
	set world of event-location to player's world
	add 9000 to x-pos of event-location
on entity portal:
	broadcast "A %type of event-entity% has entered a portal!

View source