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.

there is some method like world.getBlockId(x,y,z) in 1.7.10??? (SOLVED)

Featured Replies

Posted

Goods days

 

bad english advertisment

 

im doing a mod and ineed to know what block is in certain point in the space  (x,y,z)

 

soo example i need to know if the block a just put is two spaces over a block of wood,

 

google tell mi about this method world.getBlockId()  but i dont find it in eclipse 1.7.10.

 

soo this method is wrong, has a change name is ths version o r was replaced by something else

 

there is a pice of mi code

 

###################################################

 

 

public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_){

System.out.println("se ejecuto onBlockActivated");

 

        int x1=x;

        int y1=y-2;

        int z1=z;

 

int blockID = world.getBlockId(x1,y1,z1);                //.getBlockId(x, y, z);

       

        /*    //piece of the code from google

        if(blockID != 0) //air has no block representation

{

    Block.blocksList[blockID].translateBlockName();

}//84 80 269

*/

 

return true;

}   

 

is this deprecated or is just malformed ??

 

There are no id's in 1.7+ use world.getBlock(x,y,z); to get the block at the given coardinates.

Block block = world.getBlock(x1,y1,z1);
if (block != Blocks.air)
{
    //not sure what your trying to do here
}

[code]

I am the author of Draconic Evolution

  • Author

its something.

iwass figthing whit miself and then i find the answer

 

 

the answer is converthe block to string

 

 

System.out.println("onNeighborBlockChange");

int x=84, y=80, z=269;

   

if (world.getBlock(x, y, z) == Blocks.water ){

System.out.println("es agua lo que hay en el blocke");

}else{

System.out.println("no se que sera este blocke");

}

             

                String sb= world.getBlock(x, y, z).toString();

System.out.println("String sb= "+sb);

 

 

 

 

]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:52]: onNeighborBlockChange

[12:55:58] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:59]: es agua lo que hay en el blocke

[12:55:58] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:64]: String SB= net.minecraft.block.BlockStaticLiquid@6e4a6525

 

 

[12:56:35] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:52]: onNeighborBlockChange

[12:56:35] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:61]: no se que sera este blocke

[12:56:35] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:64]: String SB= mercenary00.mercenarymod.blocks.mercenaryBlock@161020ce

 

 

[12:56:59] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:52]: onNeighborBlockChange

[12:56:59] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:61]: no se que sera este blocke

[12:56:59] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:64]: String SB= net.minecraft.block.BlockStainedGlass@26ddc9d4

[12:56:59] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:52]: onNeighborBlockChange

 

 

i have a question more about of method but thats another treath

very gratefull

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.