Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

Posted

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?

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.

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.

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)

 

Important:

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

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.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.