ποΈInventoryContents
Here you will find all the methods that are in the InventoryContents class.
firstEqual
Searches the inventory for the passed parameter. The first item that matches is returned. Return is the slot + IntelligentItem
replaceAll
Overwrites all old items with the new items. You pass the old item. Also the new item that comes instead. Optional is a page you can specify.
replace
Overwrites an old item with the new item. You pass the old item and the new item. Optional is a page you can specify.
addAdvancedSlot
Defines a slot where players can take or place items from the inventory. However, you can add your own logic through the consumer.
removeAdvancedSlot
Removes the slot. The players are no longer able to take the item out or put another one in. Their own logic no longer works.
updateFixedPageSize
Allows while the player has the inventory open to modify the set number of pages. Optional is whether the inventory should be updated. This applies if the player would be on a page that no longer exists due to the update.
update
Updates the item within a slot the item. Furthermore, multiple slots can also be specified and 1 item.
updateOrSet
Updates the item in these slots. If there is no item in this slot, an item is set.
isIgnoredSlot
Query whether the slot is ignored.
removeIgnoredSlot
Removes a slot that is currently ignored.
addIgnoredSlot
Adds a slot, which is then ignored.
hasSlot
Query if the inventory has this slot.
removeItemWithConsumer
Removes the item and the consumer from the inventory.
removeFirst
Removes the first item that corresponds to the item you pass. Alternatively, you can pass no item and he removes the 1 item he finds.
subtractFirst
Subtracts the first item that corresponds to the item you are passing. You determine how much is removed.
removeAll
Removes all items from the inventory that match the item you give. Alternatively, you can specify a number. If you enter 64, the item is guaranteed to be removed.
slots
Returns you all the slots of the inventory.
updateTitle
Updates the title. You can set the new title
fillAligned
Depending on the orientation, you can have items fill the left, right, top or bottom of the inventory.
fillBorders
Fills the borders of the inventory.
hasPropertyKey
Checks if the inventory has a certain key.
hasPropertyValue
Checks if the inventory has a certain value.
setProperty
Sets a new value. The principle is the key:value principle. Each key receives 1 value
getProperty
Gets the value by the key. Optional is a default value you get if this key does not exist.
clearProperties
Clears all properties of the inventory. You can get through a consumer, either keys and values or only keys.
removeProperty
Removes a property of the inventory. Optional is a consumer with the value of the property.
findRightBorder
Look for the right border based on the slot you are passing.
findLeftBorder
Look for the left border based on the slot you are passing.
isMiddle
Returns a boolean if the slot you pass is in the middle.
isCorner
Returns a boolean if the slot you pass is in a corner.
isTop
Returns a boolean if the slot you pass is on the top.
isBottom
Returns a boolean if the slot you pass is on the bottom.
isRightBorder
Returns a boolean if the slot you pass is on the right border.
isLeftBorder
Returns a boolean if the slot you pass is on the left border.
firstEmpty
Returns the first empty slot
lastEmpty
Returns the last empty slot
randomSlot
Returns a random slot in the inventory. You can also pass the range in which area he should look.
add
Adds an item to the inventory in the first empty place.
reload
Reloads the entire inventory.
setWithinPage
You can set an item, but it will only be visible within this page.
fillRow
You can fill a row based on the slot. You can also specify a side on which this should happen.
fillColumn
You can fill a column based on the slot. You can also specify a page on which this should happen.
fillEmptyPage
Fills all empty slots on the page you pass.
fillPage
Fills the entire page with the item. All items will be overwritten.
fillArea
Fills the item in an area defined by you.
fillEmpty
Fills all empty slots on the current page.
fill
Fills the current page completely with the item you are passing.
set
Places an item in a specific slot.
getPositionOfItem
Contains the position of the item you passed as parameter.
getCoordinationOfItem
Contains the coordinates of the item you passed as parameter. (Row, Column)
getDataFromCurrentPage
Returns you a read-only list with the item data that is on the current page.
getDataFromPage
Returns you a read-only list with the item data located on the page you define.
getAllData
Returns a read-only list with all item data.
getWithinPage
Returns you the item that is in that slot on the page.
getOrAdd
Try to get the item in this slot. If it is not available, it will be added.
getOrSet
Try to get the item in this slot. If it is not available, it will be added to this slot.
get
Returns the item that is in this slot.
findInArea
Searches for items in an area you define.
updateLore
Updates a specific line of the item.
updateLoreAll
Updates a specific line of the item for all players who have the same inventory open.
updateMaterial
Updates the material of the item.
updateForAll
Updates the item for all players who have the same inventory open.
updateDisplayName
Updates the display name of the item
updateDisplayNameForAll
Updates the display name of the item for all players who have the same inventory open.
Last updated