Posted July 31, 20205 yr 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?
August 1, 20205 yr 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.
August 1, 20205 yr 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.
August 1, 20205 yr 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.
August 1, 20205 yr 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.