tedwurd http://jd.bukkit.org/rb/apidocs/org...InventoryOpenEvent.html#setCancelled(boolean) Should use the Javadocs more often.
tedwurd For their survival / creative inventory, this is impossible, since it's handled by the client. For other inventories like Chests or crafting tables, you can use event.setCancelled(true);
Code: @EventHandler public void openInv(InventoryOpenEvent e){ //code? e.setCancelled(true); } i need the code
InventoryOpenEvent is fired whenever the player opens ANY sort of inventory (chest, dispenser, furnace etc.). you cannot stop a player from opening their own inventory, only separate inventories.
Code:java @EventHandler public void openInv(InventoryOpenEvent e){//code? Player player = e.getPlayer(); player.closeInventory() } Did you search google for your answer first? Also, this is incorrect, as the information of whats in the inventory is on the server, not on the client. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
cowchickcen When the player opens their survival or creative inventory it will not trigger an InventoryOpenEvent.
cowchickcen The opening and closing of the Player's Inventory is handled by the client, that statement is true. He never said the information of whats in the Inventory was handled by the client, he said that the opening and closing is.
Alright, I didn't understand specifically what Dragon meant. I have a question, could you check if the player presses the key to get into the inventory or would you need spout for that? EDIT by Moderator: merged posts, please use the edit button instead of double posting.