Comments (16)
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.
@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.
What is the functionality you're trying to achieve?
from invmenu.
It's send player to MainGUI When Player Click On Item 262.
from invmenu.
$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.
@Muqsit reply
from invmenu.
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.
What Is Visible For$item
??
from invmenu.
from invmenu.
What do you mean by Visible?
from invmenu.
@Muqsit variable*
Undefined variable $item
from invmenu.
$item would be $transaction->getItemClicked() for your case.
from invmenu.
Ok
from invmenu.
@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.
@Muqsit reply
from invmenu.
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)
- Crash
- Menu doesn't open HOT 1
- Menu dosen't open HOT 4
- Error HOT 3
- crash HOT 1
- Question HOT 3
- How can we add vanilla blocks in menu? HOT 2
- Is is possible to add custom items? HOT 6
- Is it possible to add custom texture in invmenu? HOT 6
- Inventory sending HOT 11
- Sending InvMenu HOT 14
- Menu Not Work HOT 1
- Minecart chest stuff HOT 3
- Inv Bug HOT 2
- Crash
- Is it possible to open another gui when one is closed? HOT 1
- Register custom menu PM5 HOT 1
- Bug?
- 5.10.0 Error Handler
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invmenu.