Jump to content

[1.6.4]Question regarding skeletons and getting their type on spawn


skullywag

Recommended Posts

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.

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.