Posted January 18, 20169 yr good days i been working in a custome villager, and end in the conclusion than the best way to make it spawn in all the villages including mod villages is to catch the event when a vainilla villager spawns in the world and spawns mi villager in that same spot. but for reasons i end whith villages whith 10 vainilla villagers and 200 of mi custome villagers when there must be like three or four max 6 i been using this i tink for some reason is trigering more than one time per spawned villager // ########################################################################################################################3 // replace mobs @SubscribeEvent public void onEntityEnter(EnteringChunk event) { boolean disable = false; boolean enable = true; if ( enable & event.entity instanceof EntityVillager & !(event.entity instanceof aldeanoMercenario )) { int R = ((int) (Math.random() * 100)); if (R < 60) { mercenarymod.entidades.aldeanoMercenario aldeanoMercenario = new mercenarymod.entidades.aldeanoMercenario(event.entity.worldObj); aldeanoMercenario.setPosition(event.entity.posX, event.entity.posY, event.entity.posZ); event.entity.worldObj.spawnEntityInWorld(aldeanoMercenario); //event.entity.setDead(); } } } ¿¿¿ another event bether suited for this or another solution would be very apreciated Thanks for reading
January 18, 20169 yr EntityJoinWorldEvent is fired when an entity is spawned in the world. You can cancel it to prevent the entity from spawning. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.