![]() There is no way to test for when the inventory is opened, only when modifications are made. It doesn't need to ask for any data when being opened so it doesn't send any requests to the server except the initial request on server join. The Player inventory is cached client-side by choice of Mojang. MAJOR EDIT: Including NMS / OBC below original post to show how to do this with reflection. Player joins TheWalls Game, ProWalls plugin calls initGameSettings(), plugin clears player inventory and adds own item, Now my plugin should add the items of the kit. But this is, as I find, no good solution.įor better understanding here the order again: If there is no other solution I maybe had to to it with a timer, who waits a few milliseconds and adds the items than. With my current code, I see the items added from my kit a few moments in my inventory but milliseconds later, the items will be removed. So another possible solution would be, to make an event called when the plugin ProWalls calls his own method initGameSettings(). ProWalls calls the method initGameSettings() at start to save the inventory, clear it and add his own item. Then I can check if the added item is the item which is added by ProWalls at begin of the game and if this is true, I will add my own items. Now I want to try it with an Event called, when a item was added in the inventory of the player. ![]() The items will be added, before ProWalls clear the inventory and adds his own Item. I first tried it with PlayerTeleportEvent, but this is too early. My problem is now, that I need the moment, when the player is teleported to the spawnpoint. My plugin simply should let the user to select a kit before the game starts and when the game started and all players are teleported to their start locations, my plugin should add the kit items of the kit selected before. ![]() Now I'm coding a own plugin, which should extend this plulgin. I have the plugin ProWalls installed on my Minecraft TheWalls Server. I'm using the Java 1.6 SDK with the craftbukkit 1.7 API. The InventoryOpenEvent works only with chests, furnances etc, but not with the PlayerInventory. : Cannot get property EnumPropertyĪt .m_91383_(Minecraft.I need an Event which is called, when the PlayerInventory is opened or the content is changed. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |