Jump to content

EntityRegistry


Military Police15

Recommended Posts

I followed one of Harry talk's videos to create my own entity, and i have the entity itself setup and ready to go, but I'm not sure how to register it within the game as the forge/gradle file 'EntityRegistry' doesn't appear within my files, and despite several attempts to update, refresh the dependencies, and move the files manually I have had no success. I'm assuming that I have to find a new way to register the entities, whether in the entity's class itself or by using a different line of code, but i'm at a loss as to how to go about that as i'm rather new to the modding scene.

Link to comment
Share on other sites

I would use different tutorials, but there aren't very many others out there, at least i haven't really been able to find any

 

(edit) I feel dumb, i meant I need to register a mob entity, not a block entity, are they different or would they register the same way?

Edited by Military Police15
Link to comment
Share on other sites

5 minutes ago, Military Police15 said:

are they different

The are different. But they do both use the Registry events.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

Quote

I would use different tutorials, but there aren't very many others out there, at least i haven't really been able to find any

 

Here are a few sources that I find useful:

 

Forge Documentation: https://mcforge.readthedocs.io/en/latest/
Jabelar's Tutorials: http://jabelarminecraft.blogspot.com/
GreyMinecraftCoder's Tutorials: https://greyminecraftcoder.blogspot.com/
ShadowFacts' Tutorials: http://shadowfacts.net/tutorials/
TheGreyGhost's Example Mod: https://github.com/TheGreyGhost/MinecraftByExample

 

Some of them are for earlier versions, so keep an eye out for that, but they still contain some useful information nonetheless.

 

There are also more sites recommended on the Jabelar's Tutorials page. I haven't looked at them all personally, but a couple that I did check seemed promising.

Fancy 3D Graphing Calculator mod, with many different coordinate systems.

Lightweight 3D/2D position/vector transformations library, also with support for different coordinate systems.

Link to comment
Share on other sites

RegMob(Class<? extends EntityLiving> EntityClass, String entityNameIn, int solidColorIn, int spotColorIn, int prob, int min, int max, Biome... biomes) 

 

you should probably post your code if you want help.

Edited by Lea9ue
Link to comment
Share on other sites

This is what i've got for my entitylist class. I'm having trouble with 'public static final EntityType jeff = new EntityType(Jeff.class, reference.MOD_ID + "jeff");' it gives the error of: 'The constructor EntityType(Class<Jeff>, String) is undefined' I also, like i said don't know how to add the spawn egg for my entity. the code I went off of used 'setEgg' to set the spawn egg, but I think it's out of date because auto complete didn't make it show up

public class EntityList 
{
	
	public static final EntityType jeff = new EntityType(Jeff.class, reference.MOD_ID + "jeff");
	public static final EntityType[] ENTITIES = new EntityType[] { jeff };
	static
	{
		jeff.setRegistryName(reference.MOD_ID, "jeff");
		
	}
	
}

 

Link to comment
Share on other sites

1 hour ago, Military Police15 said:

This is what i've got for my entitylist class. I'm having trouble with 'public static final EntityType jeff = new EntityType(Jeff.class, reference.MOD_ID + "jeff");' it gives the error of: 'The constructor EntityType(Class<Jeff>, String) is undefined' I also, like i said don't know how to add the spawn egg for my entity. the code I went off of used 'setEgg' to set the spawn egg, but I think it's out of date because auto complete didn't make it show up


public class EntityList 
{
	
	public static final EntityType jeff = new EntityType(Jeff.class, reference.MOD_ID + "jeff");
	public static final EntityType[] ENTITIES = new EntityType[] { jeff };
	static
	{
		jeff.setRegistryName(reference.MOD_ID, "jeff");
		
	}
	
}

 

Can you verify what version you are programming for.  It looks like 1.14. All I have done is in 1.12. I'm guessing though things havent changed to the point that that's not the only code you have. You should have a main class, a entity register class, an entity class, a render class, a model class.  You should post all other then model.

Link to comment
Share on other sites

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.