How can i check if a player is clicking in a ender chest inv and a player is creative, without perform any issues? Like can't drop items to his own inventory and so?
1. Do a PlayerInteractEvent 2. Check if the e.getClickedBlock or whatever is an instanceof EnderChest 3. With the 2# do an && or another if statement and check if e.getPlayer()#GameMode is equal to creative. 4. Do whatever! P.S: Make sure to check if it isn't a block so you don't get a NullPointer!
Actually you can run a check on the type of chest, which would be useful if you don't have any type of customer enderchest or anything like that - Code (Text): if(inventory.getType()==InventoryType.ENDER_CHEST){ //do stuff }