Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

 

  • 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.

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.