So I've been creating custom entities lately and have come across this problem: Code (Text): [Server thread/WARN]: Skipping Entity with id HarvestGolem I have found several people with a similar problem however the recommended fix tends to be the method below. Spoiler: Registering Method Code (Text): public void registerGolem(Class<? extends Entity> customClass, String name, int id) { try { List<Map<?, ?>> dataMap = new ArrayList<Map<?, ?>>(); for (Field f : EntityTypes.class.getDeclaredFields()){ if (f.getType().getSimpleName().equals(Map.class.getSimpleName())){ f.setAccessible(true); dataMap.add((Map<?, ?>) f.get(null)); } } if (dataMap.get(2).containsKey(id)){ dataMap.get(0).remove(name); dataMap.get(2).remove(id); } Method method = EntityTypes.class.getDeclaredMethod("a", Class.class, String.class, int.class); method.setAccessible(true); method.invoke(null, customClass, name, id); } catch (Exception e) { e.printStackTrace(); } } The entity does not save with the world. When the chunk it is in is unloaded it gives the error Skipping Entity id. I have seen several people mentioning that it is a problem with registering. Is there anything wrong with my method of registering?
Ah, yes. I apologize for forgetting to add these details. Here is how I register the entities: Code (Text): registerGolem(HarvestGolem.class, "HarvestGolem", 54); registerGolem(SeekerGolem.class, "SeekerGolem", 54); registerGolem(GuardGolem.class, "GuardGolem", 54); registerGolem(MinerGolem.class, "MinerGolem", 54); registerGolem(BreederGolem.class, "BreederGolem", 54); And I am using 1.8.8 which uses: net.minecraft.server.v1_8_R3
Ok, the reason is simple, you used the entityId 54 which is the id of a Zombie, as i can read, you are trying to use a golem ( IronGolem ) the Id of the entity is 99 and not 54 should solve your issue You can also simply get those informations by going into the EntityTypes nms class
Not quite. The golem is a Zombie which is set to a baby. EDIT: Here is a screenshot of the Harvest Golem:
Ok, so does anything appear in the console after executing those methods? Something like "ID is already registered:" or "Cannot register to reserved id:" or similar?
I am not. You may check the log yourself if you wish: Spoiler: Log Code (Text): [11:15:55] [Server thread/INFO]: Starting minecraft server version 1.8.8 [11:15:55] [Server thread/INFO]: Loading properties [11:15:55] [Server thread/INFO]: Default game type: SURVIVAL [11:15:55] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-e4d4710-e1ebe52 (MC: 1.8.8) (Implementing API version 1.8.8-R0.1-SNAPSHOT) [11:15:56] [Server thread/INFO]: Debug logging is disabled [11:15:56] [Server thread/INFO]: Server Ping Player Sample Count: 12 [11:15:56] [Server thread/INFO]: Using 4 threads for Netty based IO [11:15:56] [Server thread/INFO]: Generating keypair [11:15:56] [Server thread/INFO]: Starting Minecraft server on xxxxxxxxxxxxxxxxxx [11:15:56] [Server thread/INFO]: Using epoll channel type [11:15:56] [Server thread/INFO]: Set PluginClassLoader as parallel capable [11:15:56] [Server thread/INFO]: [PermissionsEx] Loading PermissionsEx v1.23.4 [11:15:56] [Server thread/INFO]: [Golemry] Loading Golemry v0.1 [11:15:56] [Server thread/INFO]: [Essentials] Loading Essentials vTeamCity [11:15:56] [Server thread/INFO]: [EssentialsChat] Loading EssentialsChat vTeamCity [11:15:56] [Server thread/INFO]: **** Beginning UUID conversion, this may take A LONG time **** [11:15:56] [Server thread/INFO]: Preparing level "map" [11:15:56] [Server thread/INFO]: Preparing start region for level 0 (Seed: 7145718271811611538) [11:15:57] [Server thread/INFO]: Preparing start region for level 1 (Seed: 7145718271811611538) [11:15:58] [Server thread/INFO]: Preparing start region for level 2 (Seed: 7145718271811611538) [11:15:58] [Server thread/INFO]: [PermissionsEx] Enabling PermissionsEx v1.23.4 [11:15:58] [Server thread/INFO]: [PermissionsEx] Initializing file backend [11:15:58] [Server thread/INFO]: [PermissionsEx] Permissions file successfully reloaded [11:15:58] [Server thread/INFO]: [Golemry] Enabling Golemry v0.1 [11:15:58] [Server thread/INFO]: [Essentials] Enabling Essentials vTeamCity [11:15:58] [Server thread/INFO]: Bukkit version format changed. Version not checked. [11:15:58] [Server thread/INFO]: git-Spigot-e4d4710-e1ebe52 (MC: 1.8.8) [11:15:58] [Server thread/INFO]: 1.8.8-R0.1-SNAPSHOT [11:15:58] [Server thread/INFO]: Using locale en_GB [11:15:58] [Server thread/INFO]: Using locale en_GB [11:15:58] [Server thread/INFO]: Essentials: Using PermissionsEx based permissions. [11:15:58] [Server thread/INFO]: [EssentialsChat] Enabling EssentialsChat vTeamCity [11:15:58] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it [11:15:58] [Server thread/INFO]: Done (2.098s)! For help, type "help" or "?" [11:18:39] [User Authenticator #1/INFO]: UUID of player xTheGamerPlayz is 3ea0aa33-e7d6-4f28-b2d9-6075bd5c60dc [11:18:39] [Server thread/INFO]: xTheGamerPlayz[/66.172.68.177:56821] logged in with entity id 105 at ([map]-134.50037678192308, 144.0, -25.649476734752746) [12:11:50] [Server thread/INFO]: xTheGamerPlayz issued server command: /sg harvest
ok, so just asking for that, your entity seems to be spawned correctly? is there a new issue or what?
ok, so i found a similar solutation maybe ( https://www.spigotmc.org/threads/tutorial-creating-custom-entities-with-pathfindergoals.18519/ ) its in the 7. code text
I changed them to this: Code (Text): @SuppressWarnings({ "unchecked", "rawtypes" }) public void registerGolem(Class<? extends Entity> clazz, String name, int id){ try { //Remove the lines with // in front of them if you want to override default entities (You'd have to remove the default entity from the map first though). ((Map) getPrivateField("c", EntityTypes.class, null)).put(name, clazz); ((Map) getPrivateField("d", EntityTypes.class, null)).put(clazz, name); //((Map)getPrivateField("e", net.minecraft.server.v1_7_R4.EntityTypes.class, null)).put(Integer.valueOf(id), clazz); ((Map) getPrivateField("f", EntityTypes.class, null)).put(clazz, Integer.valueOf(id)); //((Map)getPrivateField("g", net.minecraft.server.v1_7_R4.EntityTypes.class, null)).put(name, Integer.valueOf(id)); } catch (Exception e) { e.printStackTrace(); } } public Object getPrivateField(String fieldName, Class<? extends Object> clazz, Object object) { Field field; Object o = null; try { field = clazz.getDeclaredField(fieldName); field.setAccessible(true); o = field.get(object); } catch(NoSuchFieldException e) { e.printStackTrace(); } catch(IllegalAccessException e) { e.printStackTrace(); } return o; } However when the server attempted to load them again I received the same warning: Code (Text): [12:39:53] [Server thread/WARN]: Skipping Entity with id HarvestGolem [12:39:53] [Server thread/WARN]: Skipping Entity with id GuardGolem [12:39:53] [Server thread/WARN]: Skipping Entity with id SeekerGolem [12:39:53] [Server thread/WARN]: Skipping Entity with id MinerGolem [12:39:53] [Server thread/WARN]: Skipping Entity with id BreederGolem
As a small line is already inside, check this: //Remove the lines with // in front of them if you want to override default entities (You'd have to remove the default entity from the map first though). So you may remove the // from "e" and "g" also update the nms path
I don't want to override them and I may have to override entities at a later time, so I will leave them there as they do no harm. However just to ensure that there was no misunderstanding I did so. While I did not receive the warning the entity still did not appear from the saved chunk. However this may be because I did not override the default entity as I do not know how to do so. Could you explain it to me?