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

I have got my custom spider working and I'm tweaking the AI and child code.  The spider behaves like a wolf and protects the player.  The problem I have is when I breed him, I know how to make it breed a normal spider entity, which the code considers a child, even though the model is an adult (which originally was done for a test.)  How do I make this a smaller sized child spider?  Here's my code for the createChild and I know why it creates the normal spider, but I don't know how to change it to make a smaller version of my spider.

 

    @Nullable
    @Override
    public AgeableEntity createChild(AgeableEntity ageable) {

        OrangeSpiderEntity entity = new OrangeSpiderEntity(RaydenhallEntities.ORANGE_SPIDER_ENTITY.get(), this.world);

        entity.onInitialSpawn(this.world, this.world.getDifficultyForLocation(new BlockPos(this.getPosX(), this.getPosY(), this.getPosZ())),
        SpawnReason.BREEDING, (ILivingEntityData) null, (CompoundNBT) null);

        UUID uuid = this.getOwnerId();
        if (uuid != null) {
            entity.setOwnerId(uuid);
            entity.setTamed(true);
        }

        return entity;
    }

 

This code basically makes the adult looking spider, sets owner and spawns it in.  How do I make a smaller version of the OrangeSpiderEntity?

7 hours ago, daveash said:

How do I make this a smaller sized child spider

Does your entity model inherit from AgeableModel? If so you should be able to specify the childBodyScale to make the model smaller.

  • Author

I was using the WolfEntity as an example for my spider.  My model exports from BlockBench, so it inheirits from EntityModel.  I switched my Spider model and implemented the methods to AgeableModel but could not access childBodyScale since it is private (I think I'd also need childHeadScale).  I'm using 1.16.

The wolfEntity class of the Model for that matter doesn't seem to have a scaling step to make the wolf appear as a child.  I'm sure it does, but I haven't found it yet.

27 minutes ago, daveash said:

I switched my Spider model and implemented the methods to AgeableModel but could not access childBodyScale since it is private (I think I'd also need childHeadScale).  I'm using 1.16.

If it is unchanged from 1.15, then you can specify the childBodyScale in the constructor of AgeableModel.

In fact, it's really simple. The problem is that your model inheirits from EntityModel. So first extends with AgeableModel :

public class YourModel<T extends YourEntity> extends AgeableModel<T>

 

Then, delete your render method and add :

@Override
protected Iterable<ModelRenderer> getHeadParts() {
	return ImmutableList.of(this.head);
}

@Override
protected Iterable<ModelRenderer> getBodyParts() {
	return ImmutableList.of(this.body, this.legBackRight, this.legBackLeft, this.legFrontRight, this.legFrontLeft);
}

 

The AgeableModel class will render automatically your mob and scale it correctly if it's a baby.

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.