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.

kc9zda

Members
  • Joined

  • Last visited

  1. The only problem I can think of is that you notify nearby blocks. The logs probably rotate accordingly.
  2. This example may work on 1.7.2, but I know it works on 1.6.2. If you do not know how to use tile entities, please see the tutorial on the wiki. Now, on your updateEntity method, you should have something similar to: public void updateEntity() { boolean isDay = this.worldObj.isDaytime(); if (isDay && this.worldObj.getBlockId(this.posX, this.posY, this.posZ) == ModBlocks.litBlock.blockId) { this.worldObj.setBlock(this.posX, this.posY, this.posZ, ModBlocks.darkBlock.blockId); } else { if (!isDay && this.worldObj.getBlockId(this.posX, this.posY, this.posZ) == ModBlocks.darkBlock.blockId) { this.worldObj.setBlock(this.posX, this.posY, this.posZ, ModBlocks.litBlock.blockId); } } } This is a start, but there may be some unwanted happenings once the block changes, because Minecraft probably won't like the block changing, but not the tile entity. I also didn't include the server-client syncing code (to sync with the server).
  3. I had something similar to what Draco18s had but each is in a different method: private void clearAreaCube(int x, int z, int , int zd, int y, int yd, World w) { int i = 1; while (i <= ) { clearColumnRow(x+i, z, zd, y, yd, w); i++; } } private void clearColumnRow(int i, int z, int zd, int y, int yd, World w) { int j = 1; while (j <= zd) { clearColumn(i, z+j, y, yd, w); j++; } } private void clearColumn(int i, int j, int y, int yd, World w) { int k = 1; while (k <= yd) { w.setBlockToAir(i, j, y+k); k++; } } , yd, and zd are the change in x, y and z respectively. I originally had three nested while loops and it only cleared one row of blocks. I just tried the alternative code that was suggested, and it cleared no more than last time. Both pieces of code seemed to clear trees completely from the cube, but I just think that they didn't spawn. After that, I took out the clearing code and placed the structure on the first level that could see the sky (it works in most worlds). Thanks for your help anyway.
  4. I am trying to put a platform for the player to spawn on and I want all of the platform to be at least visible and I want the player to be able to spawn on it. Currently, if it is in the side of a hill, it is useless, if it is under a tree, the player spawns on top of the tree instead of on the platform. That is why I want to clear a 9 block high area above the platform. I have code to do it, but it doesn't work. I have three nested while loops (one for x, y, and z) and it uses World.setBlockToAir. It only seems to clear either one part of a row or none at all.
  5. Yes that was the method I was talking about.
  6. In LotsOfCoalsMain.java, I think that returning the return value from eventmanager() will not work because I think it would cause an infinite loop trying to get the return value. Maybe replace that with "return new EventManager();"?
  7. Hello, I want to find an Entity at a set of coordinates specified. I need will need to access the fields of that Entity class. I am already using World.getClosestPlayer(X,Y,Z,4.0), but I don't want to access an Entity standing behind me. I have code written to try to figure out if that Entity is standing in view by comparing it to my look vector, but I don't think that the look vector would work completely. Is there some world function that finds the Entity at XYZ Coordinates and returns a reference to that Entity?

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.