It follows the same path in the inventory like you would read a book. Indexes 36 through 39 refer to the armor slots. Though you can set armor with this method using these indexes, you are encouraged to use the provided methods for those slots. Inventory invGUI = Bukkit.createInventory(null, 27, 'Custom Inventory'). (1 through 20 I believe) with each number assigned to the slot number (0-8, 17, 26-18,9. While there are clearly a large number of online real money casinos to choose from, each casino has their own stable of available games. You may be Bukkit Inventory Slot Ids looking for a casino that is Bukkit Inventory Slot Ids heavier on the Bukkit Inventory Slot Ids side of slots titles, in which case you will find these real money sites Bukkit Inventory Slot Ids to your liking. Finds all slots in the inventory containing any ItemStacks with the given ItemStack. This will only match slots if both the type and the amount of the stack match The HashMap contains entries where, the key is the slot index, and the value is the ItemStack in that slot.
Modifier and Type | Method and Description |
---|---|
int | clear(int id, int data) Deprecated. |
ItemStack[] | getArmorContents() Get all ItemStacks from the armor slots |
ItemStack | getBoots() |
ItemStack | getChestplate() Return the ItemStack from the chestplate slot |
int | getHeldItemSlot() |
ItemStack | getHelmet() Return the ItemStack from the helmet slot |
HumanEntity | getHolder() Gets the block or entity belonging to the open inventory |
ItemStack | getItemInHand() |
ItemStack | getLeggings() Return the ItemStack from the leg slot |
void | setArmorContents(ItemStack[] items) |
void | setBoots(ItemStack boots) Put the given ItemStack into the boots slot. |
void | setChestplate(ItemStack chestplate) |
void | setHeldItemSlot(int slot) Set the slot number of the currently held item. |
void | setHelmet(ItemStack helmet) |
void | setItemInHand(ItemStack stack) Sets the item in hand |
void | setLeggings(ItemStack leggings) |
addItem, all, all, all, clear, clear, contains, contains, contains, contains, contains, contains, containsAtLeast, first, first, first, firstEmpty, getContents, getItem, getMaxStackSize, getName, getSize, getTitle, getType, getViewers, iterator, iterator, remove, remove, remove, removeItem, setContents, setItem, setMaxStackSize
Cancellable
CraftItemEvent
, InventoryCreativeEvent
Because InventoryClickEvent occurs within a modification of the Inventory, not all Inventory related methods are safe to use.
The following should never be invoked by an EventHandler for InventoryClickEvent using the HumanEntity or InventoryView associated with this event:
To invoke one of these methods, schedule a task usingBukkitScheduler.runTask(Plugin, Runnable)
, which will run the task on the next tick. Also be aware that this is not an exhaustive list, and other methods could potentially create issues as well. Assuming the EntityHuman associated with this event is an instance of a Player, manipulating the MaxStackSize or contents of an Inventory will require an Invocation of Player.updateInventory()
.
Modifications to slots that are modified by the results of this InventoryClickEvent can be overwritten. To change these slots, this event should be cancelled and all desired changes to the inventory applied. Alternatively, scheduling a task using BukkitScheduler.runTask( Plugin, Runnable)
, which would execute the task on the next tick, would work as well.
Event.Result
transaction
Constructor | Description |
---|---|
InventoryClickEvent(InventoryView view, InventoryType.SlotType type, int slot, ClickType click, InventoryAction action) | |
InventoryClickEvent(InventoryView view, InventoryType.SlotType type, int slot, ClickType click, InventoryAction action, int key) |
Modifier and Type | Method | Description |
---|---|---|
InventoryAction | getAction() | Gets the InventoryAction that triggered this event. |
ClickType | getClick() | |
Inventory | getClickedInventory() | Gets the inventory that was clicked, or null if outside of window |
ItemStack | getCurrentItem() | |
ItemStack | getCursor() | Gets the current ItemStack on the cursor. |
static HandlerList | getHandlerList() | |
HandlerList | getHandlers() | |
int | getHotbarButton() | If the ClickType is NUMBER_KEY, this method will return the index of the pressed key (0-8). |
int | getRawSlot() | The raw slot number clicked, ready for passing to #getItem(int) This slot number is unique for the view. |
int | getSlot() | The slot number that was clicked, ready for passing to Inventory.getItem(int) . |
InventoryType.SlotType | getSlotType() | |
boolean | isLeftClick() | Gets whether or not the ClickType for this event represents a left click. |
boolean | isRightClick() | Gets whether or not the ClickType for this event represents a right click. |
boolean | isShiftClick() | Gets whether the ClickType for this event indicates that the key was pressed down when the click was made. |
void | setCurrentItem(ItemStack stack) | |
void | setCursor(ItemStack stack) | Deprecated. This changes the ItemStack in their hand before any calculations are applied to the Inventory, which has a tendency to create inconsistencies between the Player and the server, and to make unexpected changes in the behavior of the clicked Inventory. |
callEvent, getEventName, isAsynchronous
getInventory, getView, getViewers
getResult, getWhoClicked, isCancelled, setCancelled, setResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
ClickType.isRightClick()
ClickType.isLeftClick()
ClickType.isShiftClick()
stack
- the new cursor itemstack
- the item to be placed in the current slotInventory.getItem(int)
. Note that there may be two slots with the same slot number, since a view links two different inventories.#getItem(int)
This slot number is unique for the view.This action cannot be changed, and represents what the normal outcome of the event will be. To change the behavior of this InventoryClickEvent, changes must be manually applied.
This is insulated against changes to the inventory by other plugins.
getHandlers
in class InventoryEvent
Copyright © 2019. All rights reserved.