Jump to content

Must all entities have a constructor that only takes net.minecraft.world.World as a parameter?


Recommended Posts

While I was working on my mod my IDE complained that "All entities must have a constructor that takes one net.minecraft.world.World constructor"

//A constructor like this:
public Entity(net.minecraft.world.World world)
  //do stuff

I was wondering why, especially because the mod builds and the entity registers just fine without this constructor.

I dug around in my code inspection settings and it turns out that it belongs to the MCP inspection group.

Using a breakpoint to find it's usage didn't help since at no point during mod setup and testing (testing as in summoning the entity via the /summon command; the entity is a throwable and would use another constructor when thrown anyway).


When is this constructor used, if at all, and is that constructor important?

Link to comment
Share on other sites

2 hours ago, Keheck said:

While I was working on my mod my IDE complained that "All entities must have a constructor that takes one net.minecraft.world.World constructor"

That constructor makes me think you are using 1.12 or an earlier version. Which are not supported on this forum. Please update to a modern version of Minecraft to receive support. For more information read the LTS at the top of the page.


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

If you aren't using 1.12 (which I agree with Animefan seems like you do): The Plugin in IntelliJ which I think you're using isn't working for 1.14 and needs to be manually redownloaded with a newer version to work with newer Forge versions

My Projects:

Cruelars Triforcemod (1.12 release; 1.14 alpha soon coming)



As my mod is on at least 10 different third party sites without my permission, I want to warn you about that with a link to StopModReposts

Link to comment
Share on other sites

Oh, and for reference, that constructor is used to load the entity from disk.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.


Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.


DO NOT PM ME WITH PROBLEMS. No help will be given.

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.

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.


  • Create New...

Important Information

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