Making Blocks

Discussion in 'Plugin Development' started by Geemili, Nov 17, 2012.

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

    Geemili

    I can't figure out how to make blocks. I know how to set block and what not, but I want to create blocks that are independent of the minecraft world. I looked around for a bit, but I can't find out how to do this.

    I mean something that would look a bit like this"
    Code:
    Block block = new Block(/*Arguments...*/);
    
    Is there a way to do this?
     
  2. Offline

    leiger

    You can't create completely new blocks using a plugin. You'd need a client mod for that.
     
  3. Offline

    Geemili

    That's not exactly what I was trying to say. I meant like the actual space in minecraft.
     
  4. Offline

    Tirelessly

    Block is an anonymous inner class. I don't think you can instantiate one.
     
  5. Offline

    Jogy34

    world.getBlockAt(x, y, z).setType(Material.AIR);
    You can also use .setTypeId() and .setTypeIdAndData() etc...
     
  6. Offline

    APlusMalware

    You might be able to use BlockState for your purposes.
     
  7. Offline

    leiger

    My mistake. Check post above by Jogy34 for the solution.
     
  8. Offline

    Geemili

    That's still not exactly what I was trying to say. Let me explain what I'm trying to do:

    Basically, I want to make it so that you can make a building. Inside the building, is nothing. However, the building has a door. Whenever a person opens that door, the blocks inside get switched to their own room. I've found a workaround for this, which is to store the blocks ids and metadata separately. However, I don't think that this is the best method, so I want to know if their is a better method. I'll have to tackle the issue of entity storage later as well, but that isn't for right now.
     
  9. Offline

    Jogy34

    You basically have to store all of the blocks with their data values then replace them one by one when you need to
     
  10. Offline

    Geemili

    Ok. That is what I am currently doing.
     
Thread Status:
Not open for further replies.

Share This Page