Setblock?

Discussion in 'Plugin Development' started by MCFunCubes, Dec 20, 2015.

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

    MCFunCubes

    How do I set a block to a material? I already have declared a location, and the x, y, and z values of the block I would like to change :(. Please help!
     
  2. Offline

    Zombie_Striker

  3. Offline

    MCFunCubes

    But what about the location of the block!?
     
  4. Offline

    Zombie_Striker

    @MCFunCubes
    Code:
    World.getBlockAt(new x, new y, new z);
     
  5. Offline

    MCFunCubes

    oooooh so this would work:
    Code:
    Int x = 1;
    Int y = 1;
    Int z = 1;
    Block block = World.getBlockAt(x, y, z);
    block.setType(oak_log);
    and set the block at (1,1,1) to an oak log.
     
  6. Offline

    Zombie_Striker

    @MCFunCubes
    Yes, that should work. Test it.

    If it works, Mark this thread as solved.
     
  7. Offline

    teej107

    This thread is an example of why you should look at the JavaDocs.
     
    WolfMage1 and Zombie_Striker like this.
Thread Status:
Not open for further replies.

Share This Page