
Avien
Members-
Posts
10 -
Joined
-
Last visited
Everything posted by Avien
-
Ohh, I see what you mean. I did that so it would be easier on here to see what I was talking about. I'll fix that real quick.
-
What do you mean it doesn't compile. As in that part does nothing?
-
Ok, so I fixed the event handler problem. I'm going to see what I can do for the Entity type to fix it. Main public class CrystalMain { public static final Logger LOGGER = LogManager.getLogger(); public static final String Mod_ID = "crystalcodex"; public static final ItemGroup CRYSTAL_GROUP = new CrystalGroup("crystaltab"); public CrystalMain() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(this::setup); ItemInit.ITEMS.register(bus); BlockInit.BLOCKS.register(bus); MobRegistration.ENTITIES.register(bus); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::entityAttributeCreationEvent); } public void entityAttributeCreationEvent(EntityAttributeCreationEvent event) { LOGGER.info("Entity Attribute Event"); event.put(WeirdMobEntity.TYPE, WeirdMobEntity.MAP); } Entity public class WeirdMobEntity extends MonsterEntity{ public static final String REG = "weirdmobentity"; public static final EntityType<WeirdMobEntity> TYPE = EntityType.Builder.<WeirdMobEntity>of(WeirdMobEntity::new, EntityClassification.MISC) .sized(0.98F, 0.7F) .clientTrackingRange(8) //<--Problem area .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 WeirdMobEntity(EntityType<? extends MonsterEntity> type, World worldIn) { super(type, worldIn); } }
-
I don't think it is being called. Here's everything I have so far. Main public class CrystalMain { public static final Logger LOGGER = LogManager.getLogger(); public static final String Mod_ID = "crystalcodex"; public static final ItemGroup CRYSTAL_GROUP = new CrystalGroup("crystaltab"); public CrystalMain() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(this::setup); ItemInit.ITEMS.register(bus); BlockInit.BLOCKS.register(bus); MobRegistration.ENTITIES.register(bus); MinecraftForge.EVENT_BUS.register(this); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::entityAttributeCreationEvent); } @SubscribeEvent public void entityAttributeCreationEvent(EntityAttributeCreationEvent event) { LOGGER.info("Entity Attribute Event"); event.put(WeirdMobEntity.TYPE, WeirdMobEntity.MAP); } Mob Registration public class MobRegistration { public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, CrystalMain.Mod_ID); public static final RegistryObject<EntityType<WeirdMobEntity>> WEIRD_MOB = ENTITIES.register("weirdmobentity", () -> EntityType.Builder .<WeirdMobEntity>of(WeirdMobEntity::new, EntityClassification .CREATURE) .sized(0.9f, 0.9f ) .build("weirdmobentity")); } Mob Entity public class WeirdMobEntity extends MonsterEntity{ public static final String REG = "weirdmobentity"; public static final EntityType<WeirdMobEntity> TYPE = EntityType.Builder.<WeirdMobEntity>of(WeirdMobEntity::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 WeirdMobEntity(EntityType<? extends MonsterEntity> type, World worldIn) { super(type, worldIn); } }
-
Thank you. I've made the change and got rid of the @Mod.EventBusSubscriber at the top. As for adding it to the event bus I think its this section. public CrystalMain() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(this::setup); ItemInit.ITEMS.register(bus); BlockInit.BLOCKS.register(bus); MobRegistration.ENTITIES.register(bus); MinecraftForge.EVENT_BUS.register(this); } So I tried adding this in it. public CrystalMain() { IEventBus bus = FMLJavaModLoadingContext.get().getModEventBus(); bus.addListener(this::setup); ItemInit.ITEMS.register(bus); BlockInit.BLOCKS.register(bus); MobRegistration.ENTITIES.register(bus); MinecraftForge.EVENT_BUS.register(this); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::entityAttributeCreationEvent); //This Part } But I still am unable to summon it. Error Log https://pastebin.com/dtprYkG5
-
Yes, I am new to this language I have a lot to learn and I'm willing to. I just can't learn through being told something I need examples, that's how my brain works. Anyway alright I'll just go and figure out how static works.
-
Ok, so I added this to it. I'm unsure as to how to remove the static, unless you mean just remove the word static from the EntityAttributeCreationEvent. @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD) @SubscribeEvent public static void entityAttributeCreationEvent(EntityAttributeCreationEvent event) { LOGGER.info("Entity Attribute Event"); event.put(WeirdMobEntity.TYPE, WeirdMobEntity.MAP); }
-
I understand about half of what you said. I'm guessing you mean since it's a void and not being called anywhere, that it won't do anything. I'm trying to figure out where to call back to it in the Mob Registry so that it uses the attributes. I just don't know how to rewrite my Registry for it to work.
-
Thank you for the help. I ended up adding it, but I'm still tinkering with it trying to make it work. I think the problem now relies in my MobRegistration. Here are also the new updated files. Main https://pastebin.com/U4D0XhEK MobEntity https://pastebin.com/KYV5fb5f MobRegistration https://pastebin.com/Rb44ZRdg New Log Error (just in case) https://pastebin.com/f8yRiyC7 If I end up finding a solution on my own then I will add a new reply and leave the code up for anyone else with the same problem.
-
I'm having trouble making my entity be summoned and can't find a solution. It's based off of a normal Silverfish with the render of it using the code of the original to have the same look. MobEntity https://pastebin.com/34LqbRFQ MobRegistration https://pastebin.com/RrdMBs0s MobRenderer https://pastebin.com/en6h49wT MobModel https://pastebin.com/KwAM6kmr Error Log https://pastebin.com/hF25X9pH I appreciate any help I can get on this.