![](https://forums.minecraftforge.net/uploads/set_resources_2/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
Luis_ST
Members-
Posts
5704 -
Joined
-
Last visited
-
Days Won
73
Everything posted by Luis_ST
-
did you added the registration to your mod class constructor like this: yourClass.RECIPE_SERIALIZERS.register(FMLJavaModLoadingContext.get().getModEventBus());
-
[1.16.5] Help with custom GameRule function / CreateFluidSourceEvent
Luis_ST replied to Luis_ST's topic in Modder Support
This is currently an error in my IDE but i dont know why -
[1.16.5] Help with custom GameRule function / CreateFluidSourceEvent
Luis_ST replied to Luis_ST's topic in Modder Support
i remove the complete event and lava will create source - i export the mod and check it outside of the ide again -
[1.16.5] Help with custom GameRule function / CreateFluidSourceEvent
Luis_ST replied to Luis_ST's topic in Modder Support
that's how it should work true: can creat source false can't creat source when i set the gamrule to true/false lava always creat source but why -
I've added a few new rules to minecraft and now I'm creating the functions. But some of my functions not work / they don't work as they should. Enable lava fluid source - if the gamerule is true lava source are enabled but it dont work but why this is the code i use (BlockEvent.CreateFluidSourceEvent) https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/events/world/block/OnCreateFluidSourceEvent.java error: no matter if true or false lava can always creat source
-
you have to extends BlockNamedItem you have to creat two stem blocks one extends StemBlock the other AttachedStemBlock look how vanilla does it
-
[1.16.5] Help with Tileentity/Register TileEntityType
Luis_ST replied to Luis_ST's topic in Modder Support
it works thank you -
[1.16.5] Help with Tileentity/Register TileEntityType
Luis_ST replied to Luis_ST's topic in Modder Support
thanks but i have already fixed this problem i tried a bit but i don't understand how replace the Supplier with TileEntityType Builder -
you want to look through the block and the should be semi-translucent - semi-transparent to the light that comes through the block? than try to set getOpacity (15 no light through the block 0 all light through the block) - if you mean semi-transparent that you can't look through the block like vanilla colored glass than set the alpah of your texture if not i dont understand how semi-transparent is for you ps: i think forge can only set one rendertype
-
[1.16.5] Help with Tileentity/Register TileEntityType
Luis_ST replied to Luis_ST's topic in Modder Support
I kown but DefferredRegister will not work/I got an error which i don't understand: public static final DeferredRegister<TileEntityType<?>> TILE_ENTITIES = DeferredRegister.create(ForgeRegistries.TILE_ENTITIES, Cave.Mod_Id); public static final RegistryObject<TileEntityType<LightningRodTileEntity>> LIGHTNING_ROD = TILE_ENTITIES.register("lightminig_rod_tileentity", () -> new TileEntityType<>(LightningRodTileEntity::new, CaveBlocks.LIGHTNING_ROD.get(), null)); 1. what should i add at "null" 2. when i add the Block which the TileEntity is vaild i got this error/ my ide say there is an error: "Cannot infer type arguments for TileEntityType<>" -
[1.16.5] Help with Tileentity/Register TileEntityType
Luis_ST replied to Luis_ST's topic in Modder Support
what do you mean with "manually" is there another way to register TileEntitys -
i think you have to add notSolid to your Block Properties if you mean "xRay" you can look through the block into the world and what du you mean with
-
i just want to add to my custom block (lightning rod) a tile entity but i got an error and i know there is an error in registration but i dont know where code: (code is frome the documentation package net.luis.cave.init; import ; @Mod.EventBusSubscriber(modid = Cave.Mod_Id, bus = Mod.EventBusSubscriber.Bus.MOD) public class CaveTileEntityType { public static final TileEntityType<LightningRodTileEntity> LIGHTNING_ROD = null; @SubscribeEvent public static void registerTE(RegistryEvent.Register<TileEntityType<?>> event) { TileEntityType<?> type = TileEntityType.Builder .create(LightningRodTileEntity::new, CaveBlocks.LIGHTNING_ROD.get()) .build(null); type.setRegistryName(Cave.Mod_Id, "lightminig_rod_tileentity"); event.getRegistry().register(type); } } and the error log: net.minecraft.crash.ReportedException: Ticking block entity at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:888) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:820) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:84) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:663) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:832) [?:?] {} Caused by: java.lang.NullPointerException: Cannot invoke "net.minecraft.tileentity.TileEntityType.isValidBlock(net.minecraft.block.Block)" because the return value of "net.minecraft.tileentity.TileEntity.getType()" is null at net.minecraft.world.World.tickBlockEntities(World.java:537) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:374) ~[forge:?] {re:classloading} at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:884) ~[forge:?] {re:classloading,pl:accesstransformer:B} ... 5 more [13:52:48] [Server thread/ERROR] [minecraft/Chunk]: A TileEntity type net.luis.cave.blocks.tileentity.LightningRodTileEntity has thrown an exception trying to write state. It will not persist, Report this to the mod author java.lang.RuntimeException: class net.luis.cave.blocks.tileentity.LightningRodTileEntity is missing a mapping! This is a bug! at net.minecraft.tileentity.TileEntity.writeInternal(TileEntity.java:71) ~[forge:?] {re:classloading} at net.minecraft.tileentity.TileEntity.write(TileEntity.java:65) ~[forge:?] {re:classloading} at net.minecraft.world.chunk.Chunk.getTileEntityNBT(Chunk.java:438) ~[forge:?] {re:classloading} at net.minecraft.world.chunk.storage.ChunkSerializer.write(ChunkSerializer.java:287) ~[forge:?] {re:classloading} at net.minecraft.world.server.ChunkManager.chunkSave(ChunkManager.java:699) ~[forge:?] {re:classloading} at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:176) ~[?:?] {} at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:177) ~[?:?] {} at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195) ~[?:?] {} at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[?:?] {} at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484) ~[?:?] {} at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474) ~[?:?] {} at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150) ~[?:?] {} at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173) ~[?:?] {} at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:?] {} at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497) ~[?:?] {} at net.minecraft.world.server.ChunkManager.save(ChunkManager.java:354) ~[forge:?] {re:classloading} at net.minecraft.world.server.ServerChunkProvider.save(ServerChunkProvider.java:310) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.save(ServerWorld.java:710) ~[forge:?] {re:classloading} at net.minecraft.server.MinecraftServer.save(MinecraftServer.java:544) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.stopServer(MinecraftServer.java:583) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.stopServer(IntegratedServer.java:186) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:700) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:832) [?:?] {} and my tileentity class: package net.luis.cave.blocks.tileentity; import java.util.Random; import ; public class LightningRodTileEntity extends TileEntity implements ITickableTileEntity { Random rng = this.getWorld().rand; public LightningRodTileEntity() { super(CaveTileEntityType.LIGHTNING_ROD); } @Override public void tick() { LightningBoltEntity lightning = new LightningBoltEntity(EntityType.LIGHTNING_BOLT, this.getWorld()); lightning.setLocationAndAngles(this.getPos().getX(), this.getPos().getY(), this.getPos().getZ(), rng.nextFloat() * 360, 0); if (this.getWorld().isThundering()) { if (this.getWorld().getGameTime() % (350 - rng.nextInt(200)) == 0) { this.getWorld().addEntity(lightning); } } } }
-
i just test it with setPositionAndUpdate and it works
-
i understand when i check if the lightning is add i canceled the event and add a new lightning question: when i change the pos of the lightning the event will not called again?
-
i just creat a block which works like the minecraft lightning rod. i use to detcet if a lightning is strik the entity join world event but i got an error (null but i dont know where and why null): code: https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/events/entity/OnEntityJoinWorldEvent.java log: https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/forge-1.16.5-36.0.1-mdk/src/main/java/net/luis/cave/events/entity/player/Error Log
-
i currently fixed the error so it works thanks
-
than this while (enchantmentIterator.hasNext()) { Enchantment enchantment = (Enchantment) enchantmentIterator; if (!enchantment.isCompatibleWith(enchantmentIterator.next())) { enchantmentIterator.remove(); } }
-
while (enchantmentIterator.hasNext()) { Enchantment enchantment = (Enchantment) enchantmentIterator.next(); if (!enchantment.isCompatibleWith((Enchantment) enchantmentIterator)) { enchantmentIterator.remove(); } } so is this correct? and how to remove now the level of the enchantment?
-
but how to do that
-
so i have to convert the list to an iterator?
-
i just have a custom overlay which i render but i want to render the overlay only if the player is in 1st person
-
i tested the minecraft code a bit and vanilla trades work fine. there are no enchantment twice? so i creat my custom addRandomEnchantment and it works fine but: when i remove incompatible enchantments i got an error: private static Map<Enchantment, Integer> removeIncompatible(Map<Enchantment, Integer> enchantments) { Map<Enchantment, Integer> returnMap = new HashMap<Enchantment, Integer>(); List<Enchantment> enchantmentList = enchantments.keySet().stream().collect(Collectors.toList()); List<Integer> levelList = enchantments.values().stream().collect(Collectors.toList()); for (int i = 0; i < enchantmentList.size(); i++) { for (Enchantment enchantment : enchantmentList) { if (!enchantment.isCompatibleWith(enchantmentList.get(i))) { enchantmentList.remove(i); levelList.remove(i); } } } for (int i = 0; i < enchantmentList.size(); i++) { returnMap.put(enchantmentList.get(i), levelList.get(i)); } return returnMap; } and the error: java.util.ConcurrentModificationException: null at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1013) ~[?:?] {} at java.util.ArrayList$Itr.next(ArrayList.java:967) ~[?:?] {} at net.luis.cave.lib.EnchantmentManager.removeIncompatible(EnchantmentManager.java:144) ~[main/:?] {re:classloading} at net.luis.cave.lib.EnchantmentManager.addRandomEnchantment(EnchantmentManager.java:116) ~[main/:?] {re:classloading} at net.luis.cave.events.entity.player.interact.OnRightClickBlockEvent.PlayerInteract(OnRightClickBlockEvent.java:34) ~[main/:?] {re:classloading} at net.minecraftforge.eventbus.ASMEventHandler_24_OnRightClickBlockEvent_PlayerInteract_RightClickBlock.invoke(.dynamic) ~[?:?] {} at net.minecraftforge.eventbus.ASMEventHandler.invoke(ASMEventHandler.java:85) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:302) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {} at net.minecraftforge.common.ForgeHooks.onRightClickBlock(ForgeHooks.java:803) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading} at net.minecraft.client.multiplayer.PlayerController.func_217292_a(PlayerController.java:286) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.rightClickMouse(Minecraft.java:1407) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.processKeyBinds(Minecraft.java:1692) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runTick(Minecraft.java:1507) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:979) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:612) ~[forge-1.16.5-36.0.1_mapped_snapshot_20201028-1.16.3-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.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) ~[?:?] {} 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.0.1_mapped_snapshot_20201028-1.16.3-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.0.1_mapped_snapshot_20201028-1.16.3-recomp.jar:?] {}
-
so there is no error
-
https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk