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

Help plz promise I trust u can fix it:}

Discussion in 'Plugin Help' started by Ayush, Mar 31, 2021.

  1. Ayush

    Ayush Witch

    Messages:
    62
    I am making plugin named sbmenu on gui and I am using invmenu.
    Btw I need to add functions like command open another menu bye changing a slot item if u r able to help me PLSS give an example so I can learn fast.
    Thanks in advance;)
    Code is
    PHP:
        public function sbmenu($sender)
        {
            
    $this->menu->readonly();
             
    $this->menu->setName("§rSkyBlock Menu");
            
    $inventory $this->menu->getInventory();
                    
    $inventory->setContents(array_fill(054ItemFactory::get(ItemIds::IRON_BARS)->setCustomName(TextFormat::ITALIC)));
                    
    $inventory->setItem(13ItemFactory::get(ItemIds::SKULL3)->setCustomName("§r§eYour profile \n§a⚔Damage §d\n§a❤Health §d" $sender->getHealth() . "\n♆§aStrenght 10 \n✦§aSpeed 100 \n§a❇Crit Chance §d0\n§a✴Crit Damage  §d0.5\n§a✔Pet Luck §d10\n§a✎Intelligence §d1000IQ\n♱§aMagic Find §d19\n❉§aSea Creature chance 24%"));
                    
    $inventory->setItem(19ItemFactory::get(ItemIds::DIAMOND_SWORD)->setCustomName("§r§aSkills\n§eYou can check your skills in specific Category!"));
                    
    $inventory->setItem(20ItemFactory::get(ItemIds::PAINTING)->setCustomName("§r§cCollections\n§aYou ccan check your collections in specific categories!"));
                    
    $inventory->setItem(21ItemFactory::get(ItemIds::BOOK)->setCustomName("§r§aRecipe book")->setLore("§r§eClick to see unlocked recipes!"));
                    
    $inventory->setItem(22ItemFactory::get(ItemIds::EMERALD)->setCustomName("§r§aTrade§c§4COMING SOON§c)§r"));
                    
    $inventory->setItem(23ItemFactory::get(ItemIds::BOOK)->setCustomItem("§r§gMail log"));
                   
    $inventory->setItem(24ItemFactory::get(ItemIds::BOOK)->setCustomItem("§r§bQuest Log!\n Tap to open quest logs!"));

    $inventory->setItem(25ItemFactory::get(ItemIds::CLOCK)->setCustomItem("§r§aEVENTS!"));

    $inventory->setItem(26ItemFactory::get(ItemIds::ENDER_CHEST)->setCustomItem("§r§gEnder Chest!\n Tap to open ender storage!"));

    $inventory->setItem(31ItemFactory::get(ItemIds::CRAFTING_TABLE)->setCustomItem("§r§gCRAFTING TABLE!\n Tap to open custom crafting gui!"));
                     
            
    $this->menu->send($sender);
                 
                    }
                    
    $player $sender->getName();
    $playerItem $itemClickedItem $itemClickedWithSlotChangeAction $action): bool {
                        switch (
    $action->getSlot()) {
                            case 
    31:
              
    $this->getServer()->dispatchCommand($sender"invcraft");
                        }
                }
     
  2. Ayush

    Ayush Witch

    Messages:
    62
    @Primus
     
  3. Primus

    Primus Zombie Pigman

    Messages:
    749
    minijaham 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.