Removing items from a players quickslot

The official Rising World Soundtrack is available!
You can also get the Soundtrack on Steam
  • what are trying to do remove it , just get the number of items or place a certain amount in the .Quickslots? The only way I would know how would be to remove everything then return what you want to it. I guess you could get a count and just remove that amount too if you needed.



    void removeItem(int slot,Inventory.SlotType slotType,int amount)


    player.getInventory().removeitem(int slot,Inventory.SlotType slotType,int amount)
    use the QuickslotFocus to see which one.


    https://javadoc.rising-world.n….html#getQuickslotFocus--


    or insertNewItem.


    Item insertNewItem(short itemID,int variation,int stacksize,int slot,Inventory.SlotType slotType)From the javadocExample: Insert an item (ID 12) with stacksize of 32 into the first inventory slot

    1Inventory inventory = player.getInventory();
    2Item item = inventory.insertNewItem((short) 12, 0, 32, 0, SlotType.Quickslot);
    3if(item != null){
    4 System.out.println("Item "+item.getName()+" has been added to the inventory");
    5}


    Hope that is not too general and helps ..

  • found it!


    Code
    event.getPlayer().getInventory().removeItem()


    Code
    net.risingworld.api.objects.Inventory
    public void removeItem(int slot, Inventory.SlotType slotType, int amount)
    Removes an item (or more precisely, reduces the stack size of the item by the provided amount) from a particular slot in the inventory.
    Parameters:
    slot - the target slot you want to remove the item from.
    slotType - the target slot / inventory type.
    amount - the amount you want to remove.

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!