Create a falling gravel entity.

Discussion in 'Plugin Development' started by gmfreaky, Apr 8, 2011.

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

    gmfreaky

    Hi, I need some help on how to create a falling gravel entity. I found something about craftworld but Im stuck at that code. Is there a built-in function for this? Thank you very much.

    Greetings,
    Robin / Gmfreaky
     
  2. Offline

    redspider

    i could use some help with that, too... :(
     
  3. Offline

    caHarkness

    Have you tried just using a regular gravel block? It may or may not fall, I don't know myself, but it's worth a shot.
     
  4. Offline

    Mixcoatl

    You would likely need to invoke one of the methods on the obfuscated Minecraft classes. You should be able to fake it by placing a gravel block, as @caHarkness indicated, and triggering block physics.
     
  5. Offline

    gmfreaky

    I actually meant a gravel block that flies in a random direction, but I have already found the solution:

    Code:
    WorldServer world = ((CraftWorld) rworld).getHandle();
    EntityFallingSand sand = new EntityFallingSand(world,x,y,z,13); // 12 of 0
    sand.getBukkitEntity().setVelocity(new Vector(xspeed,yspeed,zspeed));
    world.a(sand);
     
    redspider and Mixcoatl like this.
  6. Offline

    narrowtux

    Yo that is so cool, I think you can also do this with other block types if you pass 20 instead of 13 for example.
     
  7. Offline

    matejdro

    How to do that on v1.6.6? It seems like world.a is not the same method anymore.
     
  8. Offline

    nisovin

    You might try world.addEntity().
     
  9. Offline

    matejdro

    Whoa, i have not noticed it. Thanks!
     
Thread Status:
Not open for further replies.

Share This Page