utarwyn / EnderContainers

A modern and customizable Bukkit plugin to divide enderchest into multiple inventories.
https://spigotmc.org/resources/4750/
BSD 3-Clause "New" or "Revised" License
26 stars 14 forks source link

How to delete contents? #142

Open Blaxor opened 3 years ago

Blaxor commented 3 years ago

Hello . I need to make an little implimentation of this plugin in my plugin. And i can`t find how i can delete the items from the endercontainers of a player. Can you help me please?

Blaxor commented 3 years ago

I try this but it dont work. Any other ideas? ( I know that i have max 9 enderchests , it depends on rank of player. with each max 3 rows). EnderChestManager manager = Managers.get(EnderChestManager.class); manager.loadPlayerContext(event.getPlayerOBUUID(), playerContext -> { int chests = playerContext.getAccessibleChestCount(); for (int i = 0; i < 9; i++) { playerContext.getChest(i).get().getContents().clear(); } playerContext.save(); });