Posted January 21, 201411 yr Hey all, Simple enough question, why when i put: Entity entity = EntityList.createEntityByName(this.getEntityNameToSpawn(), this.getSpawnerWorld()); if (entity instanceof EntitySkeleton && ((EntitySkeleton)entity).getSkeletonType() == 1) { System.out.println("WITHER"); } in the updateSpawner method of a mob spawner does it never print even if a wither (1) is spawned. Debug states its 0 everytime no matter what type of skeleton is spawned. Im pretty sure ive got the syntax correct and the if i just do the "entity instanceof EntitySkeleton" part its true so I know that bit works. And if for some reason the above wont work for a reason im yet to understand, does anyone know of a way of getting the type of skeleton at all? Thanks.
January 22, 201411 yr Author ok think ive found part of my problem, if you are in the nether using a mobspawner and spawning skeletons, the method onSpawnWithEgg (which is the single worst named method ever) is called, which randomly sets the skeleton type to 1 (wither). So in the overworld i can use setSkeletonType and all is fine and dandy i can spawn normal skeletons or withers at my leisure, in the nether not so much, now to find away around this behaviour.
January 22, 201411 yr Author ok so to get around this problem I created a new entity and renderer both almost exact replicas of EntitySkeleton and RenderSkeleton, registered my custom entity, then changed the onSpawnWithEgg method to remove the random setting of skeleton type (as im going to be setting this manually) then just set the attack type and weapon held in there based on skeleton type and bingo, I can now spawn what I want from a mob spawner without randomness. Not sure its the best way of sorting my issue but it works.
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.