Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

eggpasta

Members
  • Posts

    101
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

eggpasta's Achievements

Creeper Killer

Creeper Killer (4/8)

2

Reputation

  1. I have a custom biome but when i use /locatebiome on it i get an no biome located withing reasonable distance is have: public class CustomBiome { public static final void registerBiomes() { Logger LOGGER = LogManager.getLogger(); BiomeManager.addAdditionalOverworldBiomes(RegistryKey.create(Registry.BIOME_REGISTRY, new ResourceLocation(Main.MODID,"test_biome"))); ResourceLocation biome = new ResourceLocation(Main.MODID,"test_biome"); LOGGER.info(biome.getPath()); } } public class ModBiomes { public static void init() { BIOMES.register(FMLJavaModLoadingContext.get().getModEventBus()); } public static final DeferredRegister<Biome> BIOMES = DeferredRegister.create(ForgeRegistries.BIOMES, Main.MODID); static { registerBiome("test_biome",BiomeMaker::theVoidBiome); } public static RegistryObject<Biome> registerBiome(String name, Supplier<Biome> biome) { return BIOMES.register(name, biome); } } and in the main class private void setup(final FMLCommonSetupEvent event) { CustomBiome.registerBiomes(); } public Main() { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); ModBiomes.init(); MinecraftForge.EVENT_BUS.register(this); } Also the following file test_biome.json
  2. https://bleepcoder.com/minecraftforge/771739836/apple-silicon-mac-glfw-error-on-startup
  3. And the issue? Also as far as i know aternos does not support forge.
  4. Thanks, after changing some stuff, it now works
  5. The method has probably been remapped to something else
  6. https://gist.github.com/williewillus/c8dc2a1e7963b57ef436c699f25a710d
  7. MinecraftForge.EVENT_BUS.register(CapabilityProviderEntities.class); Its supposed to provide the Size capability, should i just change it to SizeCapability?
  8. I had a class i forgot to show public class CustomSizeAddEvent { @SubscribeEvent public static void attachSizeToEntityHandler(AttachCapabilitiesEvent<Entity> event) { Entity entity = event.getObject(); if(entity instanceof LivingEntity) { event.addCapability(new ResourceLocation(Main.MODID,"size_capability"), new CapabilityProviderEntities()); } } }
  9. How do i attach the capability?
  10. Ok so i have a capability with the following code but when i try to use it i get an error public class SizeCapability { @CapabilityInject(Size.class) public static Capability<Size> CAPABILITY_SIZE = null; public static void register() { CapabilityManager.INSTANCE.register(Size.class,new Size.SizeNBTStorage(),Size::createADefaultInstance); } } public class Size { public Size() { this(2); } public Size(int initialsizelevel) { sizeLevel = initialsizelevel; } public void setSizeLevel(int sizeLevelToSet) {sizeLevel = sizeLevelToSet;} private int sizeLevel; public int getSizeLevel() {return sizeLevel;} public static class SizeNBTStorage implements Capability.IStorage<Size> { @Override public INBT writeNBT(Capability<Size> capability, Size instance, Direction side) { IntNBT intNBT = IntNBT.valueOf(instance.sizeLevel); return intNBT; } @Override public void readNBT(Capability<Size> capability, Size instance, Direction side, INBT nbt) { int sizeLevel = 2; if (nbt.getType() == IntNBT.TYPE) { sizeLevel = ((IntNBT)nbt).getAsInt(); } instance.setSizeLevel(sizeLevel); } } public static Size createADefaultInstance() { return new Size(); } } public class CapabilityProviderEntities implements ICapabilitySerializable<INBT> { private final Direction NO_SPECIFIC_SIDE = null; @Override public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap,@Nullable Direction side) { if (SizeCapability.CAPABILITY_SIZE == cap) { return (LazyOptional<T>)LazyOptional.of(() -> sizeCap); } return LazyOptional.empty(); } private final static String SIZE_NBT = "size"; @Override public INBT serializeNBT() { CompoundNBT nbt = new CompoundNBT(); INBT sizeNBT = SizeCapability.CAPABILITY_SIZE.writeNBT(sizeCap, NO_SPECIFIC_SIDE); nbt.put(SIZE_NBT, sizeNBT); return nbt; } private Size sizeCap = new Size(); @Override public void deserializeNBT(INBT nbt) { if(nbt.getId() != NBTtypesMBE.COMPOUND_NBT_ID) { return; } CompoundNBT compound = (CompoundNBT)nbt; INBT sizeNBT = compound.get(SIZE_NBT); SizeCapability.CAPABILITY_SIZE.readNBT(sizeCap, NO_SPECIFIC_SIDE, sizeNBT); // TODO Auto-generated method stub } } Size size = entityLiving.getCapability(SizeCapability.CAPABILITY_SIZE).orElse(null); size.setSizeLevel(5); [08:15:06] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception net.minecraft.crash.ReportedException: Ticking player at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:137) ~[forge:?] {re:classloading} at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:865) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:787) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.tickServer(IntegratedServer.java:78) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:642) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:232) ~[forge:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:832) [?:?] {} Caused by: java.lang.NullPointerException: Cannot invoke "mod.trianglesinpoo.mcores.sizechanging.Size.setSizeLevel(int)" because "size" is null at mod.trianglesinpoo.mcores.CRYOCOCKTAIL.finishUsingItem(CRYOCOCKTAIL.java:38) ~[?:?] {re:classloading} at net.minecraft.item.ItemStack.finishUsingItem(ItemStack.java:221) ~[forge:?] {re:classloading,xf:fml:forge:filled_map.4,xf:fml:forge:itemstack} at net.minecraft.entity.LivingEntity.completeUsingItem(LivingEntity.java:2843) ~[forge:?] {re:classloading} at net.minecraft.entity.player.ServerPlayerEntity.completeUsingItem(ServerPlayerEntity.java:1057) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.LivingEntity.updatingUsingItem(LivingEntity.java:2723) ~[forge:?] {re:classloading} at net.minecraft.entity.LivingEntity.tick(LivingEntity.java:2114) ~[forge:?] {re:classloading} at net.minecraft.entity.player.PlayerEntity.tick(PlayerEntity.java:223) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.entity.player.ServerPlayerEntity.doTick(ServerPlayerEntity.java:404) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.network.play.ServerPlayNetHandler.tick(ServerPlayNetHandler.java:207) ~[forge:?] {re:classloading} at net.minecraft.network.NetworkManager.tick(NetworkManager.java:226) ~[forge:?] {re:classloading} at net.minecraft.network.NetworkSystem.tick(NetworkSystem.java:134) ~[forge:?] {re:classloading} ... 6 more [08:15:06] [Render thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Client java.lang.NullPointerException: Cannot invoke "mod.trianglesinpoo.mcores.sizechanging.Size.setSizeLevel(int)" because "size" is null at mod.trianglesinpoo.mcores.CRYOCOCKTAIL.finishUsingItem(CRYOCOCKTAIL.java:38) ~[main/:?] {re:classloading} at net.minecraft.item.ItemStack.finishUsingItem(ItemStack.java:221) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,xf:fml:forge:filled_map.4,xf:fml:forge:itemstack} at net.minecraft.entity.LivingEntity.completeUsingItem(LivingEntity.java:2843) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.entity.player.PlayerEntity.handleEntityEvent(PlayerEntity.java:415) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.client.entity.player.ClientPlayerEntity.handleEntityEvent(ClientPlayerEntity.java:447) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.network.play.ClientPlayNetHandler.handleEntityEvent(ClientPlayNetHandler.java:958) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.network.play.server.SEntityStatusPacket.handle(SEntityStatusPacket.java:35) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.network.play.server.SEntityStatusPacket.handle(SEntityStatusPacket.java:12) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.network.PacketThreadUtil.lambda$ensureRunningOnSameThread$0(PacketThreadUtil.java:19) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.doRunTask(ThreadTaskExecutor.java:136) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.RecursiveEventLoop.doRunTask(RecursiveEventLoop.java:22) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.pollTask(ThreadTaskExecutor.java:109) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.runAllTasks(ThreadTaskExecutor.java:97) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.client.Minecraft.runTick(Minecraft.java:947) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:607) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:564) ~[?:?] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.1.4_mapped_official_1.16.5-recomp.jar:?] {} AL lib: (EE) alc_cleanup: 1 device not closed
  11. Hmm ok well it's a start. so we can know if the method is triggering, add System.out.println("Triggered") Under the fire code and then run the code and check the logs for Tr
  12. remove event.getEntity() from it and change it to p_77644_3_ and also as @poopoodice said , move the fire code out of the lambda like so p_77644_1_.hurtAndBreak(1, p_77644_3_, (p_220045_0_) -> { p_220045_0_.broadcastBreakEvent(EquipmentSlotType.MAINHAND); }); p_77644_3_.setSecondsOnFire(10);
  13. You have an extra unnecessary bracket after p_22045_0_ also you still dont need the the check if it's embercleave because the method can only fire if it's embercleave so remove the check
  14. For the iteminit error get rid of () -> so it's just FlamingSword::new and for p_220045_0_ it's whatever you put here p_77644_1_.hurtAndBreak(1, p_77644_3_, (p_220045_0_) -> { so check you dont have any typos
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.