Colored Clay/Wool falling Block

Discussion in 'Plugin Development' started by The Fancy Whale, Oct 21, 2014.

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

    The Fancy Whale

    So currently I use this method to spawn a falling block
    Code:java
    1. @SuppressWarnings("deprecation")
    2. public void spawn(Player p, Material m){
    3. Location l = new Location(p.getLocation().getWorld(), p.getLocation().getX(), p.getLocation().getY() + 4,
    4. p.getLocation().getZ());
    5. FallingBlock block = p.getWorld().spawnFallingBlock(l, m, (byte)0);
    6. block.setVelocity(new Vector(0,0,0));
    7. }

    How can I spawn a falling block that is a colored wool or clay block?
    Any help is greatly appreciated, thanks!
     
  2. Offline

    Konato_K

    The Fancy Whale Ummm.... change the material and the data, maybe? I mean, it's not like you pass the parameter for nothing...
     
  3. Offline

    97WaterPolo

    The Fancy Whale
    Not exactly sure, but pass another Byte param and set that in the falling block method instead of having it as 0?
     
  4. Offline

    WesJD

    Make a parameter of a byte with your color, then cast it. Or just change the (byte) number to the data value.
     
Thread Status:
Not open for further replies.

Share This Page