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.

HConfigs

Members
  • Joined

  • Last visited

  1. Hi all, I'm fairly new to minecraft modding, but I have been struggling with the following issue for a while and couldn't find an answer. I would like to use my mod to create some structures. I have two possible ways of doing this, and as an example I apply both in the following code snippet (which is executed when a key is pressed) EntityPlayerSP player = Minecraft.getMinecraft().player; int x = 16 * player.chunkCoordX + 5; int y = 16 * player.chunkCoordY + 10; int z = 16 * player.chunkCoordZ + 5; player.world.setBlockState(new BlockPos(x,y,z), Blocks.STONE.getDefaultState() ); player.sendChatMessage( "/setblock "+ (x) + " " + (y+15) + " " + z + " stone"); When I run minecraft with this mod, open a world, press the relevant key, indeed two blocks appear. Next, I 'save and quite to title' and after that I load the world again. Then only one block (the one created by sendChatMessage) is left. In other words, the blocks created by "player.world.setBlockState" are not saved. I have a preference for using the setBlockState method, but it I would like to know how to save the blocks in that case. Does anybody know what is going on?

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.