#An error that I can't fix. "Expected 1 argument but found 0"
15 messages · Page 1 of 1 (latest)
Full code:
package net.keith.entity;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
import net.keith.Tricky;
import net.keith.entity.custom.TrickyEntity;
import net.minecraft.entity.EntityDimensions;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.SpawnGroup;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
public class ModEntities {
public static final EntityType<TrickyEntity> TRICKY = Registry.register(
Registries.ENTITY_TYPE,
// Use Identifier.of() instead of the private constructor
Identifier.of(Tricky.MOD_ID, "tricky"),
FabricEntityTypeBuilder.create(SpawnGroup.MONSTER, TrickyEntity::new)
.dimensions(EntityDimensions.fixed(0.4f, 0.8f))
.fireImmune()
.build()
);
public static void registerModEntities() {
// Ensure createTrickyAttributes() returns a built DefaultAttributeContainer
FabricDefaultAttributeRegistry.register(TRICKY, TrickyEntity.createTrickyAttributes());
Tricky.LOGGER.info("Registering Mod Entities for " + Tricky.MOD_ID);
}
}
Well, the .build() function needs a parameter
Intellij normaly shows you what you need to pass...
I'd guess it's some kind of RegistryKey
If you hover over it or retype .build it should show it
Also this Method is deprecated, so you might want to switch to another Method...
!!learnjava