Jump to content

Recommended Posts

Posted

I want to add Entities to the game but I don't know how.

I know how you add a block,

 

First, you make a block class:

894867073_ScreenShot2019-08-28at10_32_11AM.png.4c05fc5bed47cac5dde16d7169e9d422.png

 

Then you call that in a ModBlocks class:

1244531020_ScreenShot2019-08-28at10_33_21AM.png.3e4c484604f80937965bd82dfdab7a1f.png

 

Then you Register the Block and the Block Item:

1615067529_ScreenShot2019-08-28at10_34_06AM.png.02c2baadca657024358e4440d28658cf.png

 

824745149_ScreenShot2019-08-28at10_35_15AM.png.c0ff63d3f88043b029beca61a096d8b5.png

 

And then you would have the Blockstate and Block Models and Textures.

 

Those are all the steps to making a Block,

But what are all the steps to making an Entity?

I know Block Bench has an Entity Model creator thing but I do not know how to use it.

 

could someone please explain

Posted

I'm assuming you're using MC 1.14.4.

Registering Entities is very similar to registering other game Objects, and extremely similar to registering TileEntities in that you actually register Types rather than the Entity itself. Here's an example:

    //Entities
    @ObjectHolder("wabbit")
    public static final EntityType<WabbitEntity> wabbit = null;

    @SubscribeEvent
    public static void registerEntities(final RegistryEvent.Register<EntityType<?>> event) {
        LOGGER.debug("Wabbits: Registering Entities...");
        event.getRegistry().registerAll(
                EntityType.Builder.create(WabbitEntity::new, EntityClassification.CREATURE)
                .build("wabbit").setRegistryName(Constants.MOD_ID, "wabbit");
        );
    } //registerEntities()


You'll probably want a model for your Entity. Try reading https://mcforge.readthedocs.io/en/1.13.x/models/introduction/ (outdated) to get started. You ought to search through the vanilla files (I'd recommend the Slime or the Rabbit) to see how they make theirs, and you could use a program like Blender to create .obj models if you decide to go that route.

You'll likely need to create a special Renderer for you model. Try looking at the vanilla files to see how this works. As for registering your Renderer, try looking at this: https://stackoverflow.com/questions/37126170/irenderfactory-help-in-minecraft-forge (outdated, but the factory still works).

Finally, I have some code you can look at if you need more help. Note that it's mostly throw-away code and not very good, so you ought to use it as an example only.
EntityType Example
Entity and Goal Example
Renderer and Model Example

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.