Player (Type) — Skript

Addon: Skript · Category: Type · Since: 1.0 · Usage: parsing an offline player as a player (online) will return nothing (none), for that case you would need to parse as offlineplayer which only returns nothing (none) if player doesn't exist in minecraft databases (name not taken) otherwise it will return the player regardless of their online status.

Syntax

player

Description

A player. Depending on whether a player is online or offline several actions can be performed with them, though you won't get any errors when using effects that only work if the player is online (e.g. changing their inventory) on an offline player. You have two possibilities to use players as command arguments: <player> and <offline player>. The first requires that the player is online and also accepts only part of the name, while the latter doesn't require that the player is online, but the player's name has to be entered exactly.

Examples

set {_p} to "Notch" parsed as a player # returns <none> unless Notch is actually online or starts with Notch like Notchan
set {_p} to "N" parsed as a player # returns Notch if Notch is online because their name starts with 'N' (case insensitive) however, it would return nothing if no player whose name starts with 'N' is online.

View source