Class BankInventoryEntity
- java.lang.Object
-
- com.kraken.api.core.AbstractEntity<ContainerItem>
-
- com.kraken.api.query.container.bank.BankInventoryEntity
-
- All Implemented Interfaces:
Interactable<ContainerItem>
public class BankInventoryEntity extends AbstractEntity<ContainerItem>
-
-
Field Summary
-
Fields inherited from class com.kraken.api.core.AbstractEntity
ctx, raw
-
-
Constructor Summary
Constructors Constructor Description BankInventoryEntity(Context ctx, ContainerItem raw)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcount()Returns the quantity of the item in your inventory when the bank interface is open.booleandeposit(int amount)Deposits a set amount of the given item from the players inventory to the bank.booleandepositAll()Deposits all of the given item from the players inventory into the bank.booleandepositFive()Deposits five of the given items from the players inventory into the bank.booleandepositOne()Deposits one of the given item from the players inventory into the bank.booleandepositTen()Deposits ten of the given items from the players inventory into the bank.intgetId()The item ID for the wrapped game entityjava.lang.StringgetName()The game entities name.booleaninteract(java.lang.String action)Interacts with the entity using the given action verb.booleanwear()Attempts to wear an item in the inventory while the bank interface is open.booleanwield()Attempts to wield an item in the inventory while the bank interface is openBankInventoryEntity.booleanwieldOrWear()Attempts to wield or wear an item in the inventory while the bank interface is open.-
Methods inherited from class com.kraken.api.core.AbstractEntity
equals, hashCode, isNull, raw
-
-
-
-
Constructor Detail
-
BankInventoryEntity
public BankInventoryEntity(Context ctx, ContainerItem raw)
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:InteractableThe game entities name.- Returns:
- The name of the game entity i.e. NPC name for NPC's, item name for ContainerItem's, and GameObject name for various game objects.
-
interact
public boolean interact(java.lang.String action)
Description copied from interface:InteractableInteracts with the entity using the given action verb.- Parameters:
action- The menu action to trigger (e.g., "Attack", "Talk-to", "Take")- Returns:
- true if the interaction packet was successfully queued/sent
-
getId
public int getId()
Description copied from interface:InteractableThe item ID for the wrapped game entity- Returns:
- int Item id
-
count
public int count()
Returns the quantity of the item in your inventory when the bank interface is open.- Returns:
- Int the quantity of the bank inventory entity (this will be the stack size of the item if its noted) or the value of the item if it's coins.
-
depositOne
public boolean depositOne()
Deposits one of the given item from the players inventory into the bank.- Returns:
- true if the deposit was successful and false otherwise.
-
depositFive
public boolean depositFive()
Deposits five of the given items from the players inventory into the bank.- Returns:
- true if the deposit was successful and false otherwise.
-
depositTen
public boolean depositTen()
Deposits ten of the given items from the players inventory into the bank.- Returns:
- true if the deposit was successful and false otherwise.
-
deposit
public boolean deposit(int amount)
Deposits a set amount of the given item from the players inventory to the bank. If the amount is not one of: 1, 5, or 10 then all of the given item will be deposited by default.- Parameters:
amount- The amount of the item to deposit: 1, 5, 10, or any other integer for all of the item- Returns:
- True if the deposit was successful and false otherwise
-
depositAll
public boolean depositAll()
Deposits all of the given item from the players inventory into the bank.- Returns:
- True if the deposit was successful and false otherwise.
-
wieldOrWear
public boolean wieldOrWear()
Attempts to wield or wear an item in the inventory while the bank interface is open. The method will find the first matching action onBankInventoryEntityeither "wield" or "wear" and invoke the action. This is useful when you have a combination of weapons and items in the inventory that need to be equipped or wielded.- Returns:
- True if the wield/wear action was successfully invoked and false otherwise.
-
wear
public boolean wear()
Attempts to wear an item in the inventory while the bank interface is open.The action is typically used to equip wearable items such as armor or accessories from the player's bank inventory.
Note: This method does not validate whether the "Wear" action is supported for the current bank inventory entity, nor does it handle cases where this action fails or is unavailable. Validation and exception handling should be implemented as needed in upstream logic.
- Returns:
trueif the "Wear" action is invoked without encountering any internal errors. The return value does not guarantee the success of the action within the context of the game.
-
wield
public boolean wield()
Attempts to wield an item in the inventory while the bank interface is openBankInventoryEntity.This action is typically used to equip items such as weapons or tools from the player's bank inventory.
Note: This method does not validate if the "Wield" action is supported for the current bank inventory entity or if the action is successful within the game. Additional validation and error handling should be implemented in the calling logic as necessary.
- Returns:
trueif the "Wield" interaction is invoked successfully without any internal client error. The return value does not guarantee that the action completes as intended within the game.
-
-