-
Recently Browsing
No registered users viewing this page.
-
Posts
-
By FireSlash_YT · Posted
Didn't let me make spoiler I will post in reply below didn't want to make a giant message -
Thanks for all your help. Here is the method that seems to register the attributes correctly. Entity Class: public class TestEntity extends CowEntity { public static final String REG = "simple_entity"; public static final EntityType<TestEntity> TYPE = EntityType.Builder.<TestEntity>of(TestEntity::new, EntityClassification.MISC) .sized(0.98F, 0.7F) .clientTrackingRange(8) .build(REG); public static final AttributeModifierMap MAP = AttributeModifierMap.builder().add(Attributes.MAX_HEALTH, 20.0) .add(Attributes.MOVEMENT_SPEED, 20.0) .add(Attributes.FOLLOW_RANGE, 20.0) .build(); public TestEntity(EntityType<? extends CowEntity> p_i48567_1_, World p_i48567_2_) { super(p_i48567_1_, p_i48567_2_); this.setNoAi(true); } } Main Class: @Mod(Main.MODID) public class Main { //trim public Main() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.register(this.getClass()); //trim LOGGER.info("STAR has been initialised"); } //trim @SubscribeEvent public static void entityAttributeCreationEvent(EntityAttributeCreationEvent event) { LOGGER.info("STAR - Entity Attribute Event"); event.put(TestEntity.TYPE, TestEntity.MAP); } //trim } Now I seem to have an error where there is no defined ai for the entity causing a ticking crash but I'll make a separate topic for that.
-
Topics
-
Who's Online (See full list)
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.