Jump to content

]Solved][1.16.1] Adding new parameter in custom entity constructor


Recommended Posts

Posted (edited)

I am making an new modded entity, but I want it to have an "owner" field, so I want to add another parameter in the constructor of the entity, but I'm getting an error on the following code. Not even adding multiple constructors works. How would I make it so that you can add another parameter or at least initialize the field? Also, where does the game even get the world and type parameter for the /summon command?

RegistryObject<EntityType<CustomEntity>> CUSTOM_ENTITY = ENTITY_TYPES.register("custom_entity", () -> EntityType.Builder.create(CustomEntity::new, EntityClassification.AMBIENT).size(1, 1).build(new ResourceLocation(Main.MOD_ID, "custom_entity").toString()));
Edited by DavidQF555

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.