Posted July 29, 20205 yr 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 August 1, 20205 yr by DavidQF555
July 29, 20205 yr EntityType.<CustomEntity>Builder.create(CustomEntity::new, ...) https://docs.oracle.com/javase/tutorial/extra/generics/index.html
July 29, 20205 yr Author 22 minutes ago, poopoodice said: EntityType.<CustomEntity>Builder.create(CustomEntity::new, ...) https://docs.oracle.com/javase/tutorial/extra/generics/index.html Now I'm just getting an error saying that the period after Builder should be a '('.
July 29, 20205 yr Sorry it should be EntityType.Builder.<CustomEntity>create(CustomEntity::new, ...) my bad Edited July 29, 20205 yr by poopoodice
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.