Giter Club home page Giter Club logo

Comments (16)

Muqsit avatar Muqsit commented on July 30, 2024

The code doesn't seem to interact with InvMenu's API, but ItemFactory::getInstance()->get(0, 0, 0) must be replaced with VanillaItems::AIR(). Alternatively, you can use a simpler $inv->clear(21);.

from invmenu.

GabBiswajit avatar GabBiswajit commented on July 30, 2024

@Muqsit what is use if($itemOutId === 262 && $itemOutMeta === 0) { $this->MainGUI($player); } In Pm5 This Is Not Work..

$inv->setItem(48, GlobalItemDataHandlers::getDeserializer()->deserializeStack(GlobalItemDataHandlers::getUpgrader()->upgradeItemTypeDataInt(262, 0, 1, null))->setCustomName("§r §cBack §r\n§r §7click to go back to the privious menu §r"));
I Use This

from invmenu.

Muqsit avatar Muqsit commented on July 30, 2024

What is the functionality you're trying to achieve?

from invmenu.

GabBiswajit avatar GabBiswajit commented on July 30, 2024

It's send player to MainGUI When Player Click On Item 262.

from invmenu.

GabBiswajit avatar GabBiswajit commented on July 30, 2024

$inv->setItem(48, VanillaBlocks::STONE()->setCustomName("§r §cBack §r\n§r §7click to go back to the privious menu §r"));

NOW CAN YOU TELL ME HOW I DO THIS WHEN PLAYER CLICK ON STONE THAN SEND THE PLAYER TO MainGUI ??
@Muqsit

from invmenu.

GabBiswajit avatar GabBiswajit commented on July 30, 2024

@Muqsit reply

from invmenu.

Muqsit avatar Muqsit commented on July 30, 2024

Item ID and meta were removed in PM5. Use Item::getTypeId() instead for comparison:

if($item->getTypeId() === ItemTypeIds::fromBlockTypeId(VanillaBlocks::STONE()->getTypeId())){
	// send player to main gui
}

I'd suggest familiarizing with PocketMine API 5 changes that were officially documented. It includes a broader range of changes: https://github.com/pmmp/PocketMine-MP/blob/stable/changelogs/5.0.md#pocketmineitem

Alternatively, if the 'back button' is always present in slot 48, you can simply check for slot instead: if($transaction->getAction()->getSlot() === 48){ ... }.

from invmenu.

GabBiswajit avatar GabBiswajit commented on July 30, 2024

What Is Visible For$item ??

from invmenu.

GabBiswajit avatar GabBiswajit commented on July 30, 2024

@Muqsit

from invmenu.

Muqsit avatar Muqsit commented on July 30, 2024

What do you mean by Visible?

from invmenu.

GabBiswajit avatar GabBiswajit commented on July 30, 2024

@Muqsit variable*
Undefined variable $item

from invmenu.

Muqsit avatar Muqsit commented on July 30, 2024

$item would be $transaction->getItemClicked() for your case.

from invmenu.

GabBiswajit avatar GabBiswajit commented on July 30, 2024

Ok

from invmenu.

GabBiswajit avatar GabBiswajit commented on July 30, 2024

@Muqsit It's Work ??

if($item->getTypeId() === ItemTypeIds::fromBlockTypeId(VanillaItems::AIR()->getTypeId())) { $member = str_replace(["§r §e", " §r"], ["", ""], $itemOutName); $this->Management($player, $member); }

$inv->setItem(20, VanillaItems::AIR());

$inv->setItem(21, VanillaItems::AIR());

from invmenu.

GabBiswajit avatar GabBiswajit commented on July 30, 2024

@Muqsit reply

from invmenu.

Muqsit avatar Muqsit commented on July 30, 2024

I unfortunately cannot help further without knowing the intricate details of your goal. You'll have to work on that by yourself. Look around the wiki for further documentation and examples:

from invmenu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.