Hi all, for my plugin i need to make a new profession for villager same as a NPC guard with event for fight and protect area. First i don't know...
Tested on 818 and work :)
it's not a problem, and yes it work, but because this method was deprecated and if they deleted it some plugin don't work, it's for that i prefer...
Yeah but you use p.updateInventory(); :) and that's deprecated :p
yes because i havn't wrote it, i don't want use a deprecated method ... On the bottom of my code i have : // player.updateInventory(); And you...
if(player.getItemInHand().getAmount() > buyPrice) player.getItemInHand().setAmount(player.getItemInHand().getAmount() - buyPrice); else...
no, inventory update work only with this method : updateInventory(), if you don't use that, all new item stacked isn't showed ( icons or number )....
Return an error too, because you can't add null item ... :( EDIT : it's for that if use : if(items != null) { ... }
I'm right, thank for your help, but he doesn't work, that crash all of inventory content and return error.
Ok, i have use an itemstack for replace old items as the same position in the inventory ! :) i test that EDIT : just replace...
My last code : ItemStack[] items = player.getInventory().getContents(); player.getInventory().clear(); for(int i=0; i<35; i++) { if(items[i]...
Oh ^^ if i understand right, i wanna update my inventory after an interaction with a sign ( shop sign ), selling buying are good, but the method...
aimin ? :s sorry i don't understand :(
player.setContents(item), doesn't work ecause seContents() for player doesn't exist :s and yea i know with getContents() i get the content ... i...
Oh ok, i test that thank you I have test with that : public void updatePlayerInventory(Player player) { player.getInventory().addItem(new...
Separate names with a comma.