Apply Block Physics on Block

Discussion in 'Plugin Development' started by Diogyn, Sep 22, 2011.

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

    Diogyn

    Hi. First, my applause to the bukkit dev team who update to 1.8.1 minecraft version.

    I work on a new plugin and want to fall somes blocks under some condition. They have to fall as if they were sand or gravel, but it have to stay wooden plank or other.
    I tried this :
    Code:
    public void onBlockPhysics(BlockPhysicsEvent event) {
         Block b = event.getBlock();
         if(b.getLocation().add(0, -1, 0).getBlock().getTypeId() == 0) {
              b.setData(b.getData(), true);
         }
    }
    But the block don't fall, it just test if it have to fall.
    Have you an other idea ?
    How works the block data ?
     
  2. Offline

    dralletje

    correct me if I am wrong, but you want a plugin to make gravel and sand blocks fall?
    that is standard in minecraft isn't it?
     
  3. Offline

    Diogyn

    ... Can I be stupid at this point ? :) Sorry if I wasn't clear.
    I want to make wooden plank and dispenser fall. And I want to choose when it happen.
     
  4. Offline

    dralletje

    wooden planks can't fall, only gravel and sand can.
    If you want dispencers to fall you have to make a client mod.
     
  5. Offline

    Diogyn

    And there is no other solution to change the data of the block or other ?
     
  6. Offline

    dralletje

    maybe there will be using spout, or you can check if there is nothing beneat a dispencer, change it to sand and then if it is fallen down change it back to dispencer.

    or you can just set the block beneat to dispencer and remove the actual dispencer, but then there is no nice animation or something :(
     
  7. Offline

    Diogyn

    Thanks, I'll change it to sand. I've not learn to use Spout for now...
    Bye
     
Thread Status:
Not open for further replies.

Share This Page