On Player Pick Item (Event) — Skript

Addon: Skript · Category: Event · Since: 2.15

Syntax

[on] [player] pick[ing] [of] [an|any] item

Description

Called when a player picks an item, block or an entity using the pick block key (default middle mouse button). The past event-slot represents the slot containing the item that will be put into the players hotbar, or nothing, if the item is not in the inventory. The event-slot represents the slot in the hotbar where the picked item will be placed. Both event-slots may be set to new slots.

Event Values

  • event-player
  • event-slot
  • event-world
  • past event-slot

Examples

on player picking a diamond block:
	cancel event
	send "You cannot pick diamond blocks!" to the player

View source