Jump to content

Recommended Posts

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?

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

Posted

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.

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

Posted

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

×   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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • I have compiled a modpack of about 230 mods for Minecraft 1.20.1 on forge 47.4.0. I am not seeing any problems of dependencies, just the single error of some kind of plug in. I don't know what is happening with it or how to fix it. [20:08:49] [main/ERROR]:Error loading companion plugin class [com.stereowalker.tiered.mixin.TieredMixinPlugin] for mixin config [tiered.mixins.json]. The plugin may be out of date: UnsupportedClassVersionError:com/stereowalker/tiered/mixin/TieredMixinPlugin has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0
    • Supreme Peregrine Recovery provided exceptional assistance in recovering my compromised Ethereum wallet, for which I am immensely grateful. When I found out that my wallet had been compromised, I felt nervous and uneasy. Using their experience to assess the issue and put recovery plans into action, the Supreme Peregrine Recovery team moved swiftly into action. They were incredibly professional, communicated frequently, and dedicated to my case. With their help, I was able to retrieve my lost funds and get back into my wallet. I strongly suggest Supreme Peregrine Recovery to anyone dealing with comparable issues. I am incredibly thankful for their assistance in making an overwhelming situation livable. +1,8,7,0,2,2,6,0,6,5,9 Mail: supremeperegrinerecovery(@)proton(.)me supremeperegrinerecovery567(@)zohomail(.)com info(@)supremeperegrinerecovery(.)com
    • Figured out my problem. I wasn't calling the class in the registration.
    • I'm trying to make a modpack for myself and I found out that Oculus is making my game crash. I loaded Minecraft with just Oculus and it still kept giving exit code 1. Please bear with me since I'm not too familiar with how modding works, I just put mods together and hope everything works haha.   Crash Report: https://pastebin.com/5giXEdS6
  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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