Setting a block through a ID at a specific location.....

Discussion in 'Plugin Development' started by -_Husky_-, Apr 26, 2012.

Thread Status:
Not open for further replies.
  1. Offline


    Ok, i need to set a block at a location, with a ID of a block. is it possible?

    for example.

    int x = p.getLocation().getBlockX();
    int y = p.getLocation().getBlockY();
    int z = p.getLocation().getBlockZ();
    int id = 1; // this is stone- i need to set x,y,z to ID 1 (stone)
  2. Offline


    Here you go:
    Block block = world.getBlockAt(x,y,z);
    -_Husky_- likes this.
  3. Offline


    firstly you can use location.getBlock, and secondly it's easier to read the code if you use a Material:
    vtg_the_kid likes this.
Thread Status:
Not open for further replies.

Share This Page