1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

how i do set default size baseinventory?

Discussion in 'Development' started by nashipy, Feb 2, 2021.

  1. nashipy

    nashipy Creeper

    Messages:
    5
    PHP:
    <?php

    namespace SeferA\bagsystem;

    use 
    pocketmine\inventory\BaseInventory;

    class 
    BagInventory extends BaseInventory
    {

        public function 
    getName() : string {
          return 
    "Bag";

        }

        public function 
    getDefaultSize() : int {
              return 
    10;

         }

    }

    ?>
     
    SeferA likes this.
  2. SeferA

    SeferA Spider

    Messages:
    6
  3. nashipy

    nashipy Creeper

    Messages:
    5
    I'm submitting the inventory code:
    PHP:
    $player->addWindow(new BagInventory);
     
  4. nashipy

    nashipy Creeper

    Messages:
    5
    Nothing happens :'(
     
  5. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    You need to extend ContainerInventory to open it to the player
     
  6. Emirhan Akpınar

    Emirhan Akpınar Slime

    Messages:
    90
    you can't set size of inventory in bedrock, not yet implemented
     
    Mcbeany likes this.
  7. Moonafic

    Moonafic Silverfish

    Messages:
    24
    you can but its really shitty
     
  8. Mcbeany

    Mcbeany Spider Jockey

    Messages:
    33
    GitHub:
    mcbeany
    or just replace the inventory with amount of items, ez
     
    Emirhan Akpınar likes this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.