Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

klokklok

Members
  • Joined

  • Last visited

Everything posted by klokklok

  1. What do you exactly mean with the constant of the block class? If I try: System.out.println(event.getChunk().getBlock(x,y,z).toString()); This still ends up spamming only air blocks like this: net.minecraft.block.BlockAir@503ecb24 If I'm right thats the constant of the block or isn't it?
  2. I figured out why it didn't seem to work on multiplayer servers. I was checking for stone blocks in the chunk and logging that to the console. It worked fine on singleplayer but for some reason on multiplayer the chunk.getBlock() only returns air blocks and finds nothing else. This is what I have tried: @SubscribeEvent public void LoadChunk(ChunkEvent.Load event){ for(int x = event.getChunk().xPosition*16; x<(event.getChunk().xPosition*16)+15; x++){ for(int y = 0; y < 256; y++){ for(int z = event.getChunk().zPosition*16; z<(event.getChunk().zPosition*16)+15; z++){ if(event.getChunk().getBlock(x,y,z) != Block.getBlockById(0)){ System.out.println("Block : " + x + "," + y + "," + z); } } } } } This code spams my console in multiplayer. If I change getBlockById to 1 it finds nothing in multiplayer and still works in singleplayer. Why does this happen?
  3. Allright I got it working now on singleplayer with MinecraftForge.EVENT_BUS.register(new Events()); But for some reason none of these events call on multiplayer servers? Do I need another event for this? I'm working with world generating.
  4. What do you exactly mean? This is the full code I came up with so far: @EventHandler public void preInit(FMLPreInitializationEvent event) { FMLCommonHandler.instance().bus().register(new Events()); System.out.println("Event Handler Initialized"); } Events class looks like this: public class Events { @SubscribeEvent public void LoadChunk(ChunkDataEvent.Load event){ System.out.println("Chunk loaded x:" + event.getChunk().xPosition + " z:" + event.getChunk().zPosition); } }
  5. Hello, I'm new to modding in minecraft and I was testing around with some events. I was wondering why ChunkDataEvent.Load never calls when loading into a map/server. @SubscribeEvent public void LoadChunk(ChunkDataEvent.Load event){ System.out.println("Chunk loaded x:" + event.getChunk().xPosition + " z:" + event.getChunk().zPosition); } Did I miss something? The console returns no errors and also the default Init event seems to work fine. Thanks for reading/helping!

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.