Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- for (World world : getServer().getWorlds()) {
- for (Chunk c : world.getLoadedChunks()) {
- CraftChunk cc = (CraftChunk) c;
- Field f = net.minecraft.server.v1_9_R1.Chunk.class.getDeclaredField("entityCount");
- f.setAccessible(true);
- gnu.trove.map.hash.TObjectIntHashMap<Class<?>> counts = (TObjectIntHashMap<Class<?>>) f.get(cc.getHandle());
- TObjectIntIterator<Class<?>> it = counts.iterator();
- while (it.hasNext()) {
- it.advance();
- Class<?> key = it.key();
- int value = it.value();
- if (value != 0) {
- System.out.println(key + ": " + value);
- }
- }
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment