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.

BR3TON

Members
  • Joined

  • Last visited

  1. Hi, I am calling my change block state method from server tick event grabbing the world from the dimension ID but the blocks don't change in the world. @EventHandler @SubscribeEvent public void serverTickEvent(TickEvent.ServerTickEvent e) { World world = DimensionManager.getWorld(0); //worldTicks = world.getTotalWorldTime(); for (int i = 0; i < world.playerEntities.size(); i++) { EntityPlayer player = (EntityPlayer) world.playerEntities .get(i); int randX = world.rand.nextInt(16); int randZ = world.rand.nextInt(16); int playerPosX = MathHelper.floor_double(player.posX); int playerPosZ = MathHelper.floor_double(player.posY); int randY = getTopBlock(world, randX + playerPosX, randZ + playerPosZ); byte effectRange = 7; for (int zOffset = -effectRange; zOffset <= effectRange; zOffset++) { BlockPos blk = new BlockPos(randX + playerPosX, randY, randZ + playerPosZ); IBlockState block = world.getBlockState(blk); // setBlockState(Blocks.dirt, new BlockPos(blk.getX(), blk.getY(), blk.getZ()), world); // if its grass /*if (block == Blocks.grass || block == Blocks.mycelium) { setBlockState(Blocks.dirt, new BlockPos(blk.getX(), blk.getY(), blk.getZ()), world); } else { System.out.println("No Grass"); }*/ } } } //} private void setBlockState(Block block, BlockPos pos, World world) { if (!world.isRemote) { IBlockState state0 = block.getDefaultState(); world.setBlockState(pos, state0); System.out.println("Block changed"); } else { System.out.println("Block not changed"); } } The console spams out Block changed so the code is being ran but I see no visual change in the world.

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.