Slot Index (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.2-dev35, 2.8.0 (raw index)

Syntax

[the] [(raw|unique)] index of %slots%

Description

Index of an an inventory slot. Other types of slots may or may not have indices. Note that comparing slots with numbers is also possible; if index of slot is same as the number, comparisonsucceeds. This expression is mainly for the cases where you must for some reason save the slot numbers.

Raw index of slot is unique for the view, see <a href="https://wiki.vg/Inventory">Minecraft Wiki</a>

Examples

if index of event-slot is 10:
	send "You bought a pie!"
if display name of player's top inventory is "Custom Menu": # 3 rows inventory
	if raw index of event-slot > 27: # outside custom inventory
		cancel event

View source