block throwing (throw a block)

Discussion in 'Archived: Plugin Requests' started by creepycrafter4, Nov 9, 2012.

  1. Offline

    creepycrafter4

    i saw this and it could be usefull!

    Plugin category: RPG

    Suggested name: blockthrow

    What I want: when i do /bt i activate block throwing mode. when in block throwing mode i can right-click a block around me. when i right-click in air after that, i throw the block in that direction.
    when there is a player or mob (or another block) in the line of the block, the block stops moving. the block stops after a set distance. (config file)

    Ideas for commands: /bt (activate block throwing mode)

    Ideas for permissions: bt.use (self-explaining, default op)

    When I'd like it by: ASAP :):)

    [diamond][diamond][diamond][diamond] when you do it haha
     
  2. Offline

    piano9uber

    The direction part may not be that easy, and to shoot it in that direction, you need to use explosions. I don't know excatly how to do this, but I know how to do explosions and falling blocks.
     
  3. Offline

    creepycrafter4

    the other thread (this) says a block has setvelocity now.
    i don't know much about it but shouldn't that work?
     
  4. Offline

    Hoolean

    I've been experimenting with a plugin of mine and I can confirm that FallingBlock and setVelocity() works perfectly! This would be possible.

    You could even make a less smooth one with normal blocks!
     
  5. Offline

    creepycrafter4

  6. Offline

    Kidd0Elite

    It's possible.

    I'm new to coding bukkit plugins and I want to do a similar thing. The problem is you have to get the players direction and then turn that into x and z velocity's to get the right direction. (I think).

    Does anyone know how to do this?

    EDIT: I think I've found it use...
    .setvelocity(new Vector(player.getlocation().getdirection()));

    Or something similar
     
  7. Offline

    Necrodoom

  8. Offline

    Kidd0Elite

    necrodoom pretty cool I just figured out exactly what I wanted and what I think creepycrafter4 wanted.
    Heres my code:

    Code:
    FallingBlock block = player.getLocation().getWorld()
                        .spawnFallingBlock(location, Material.FIRE, (byte) 0);
                player.sendMessage("FALLING!");
                Vector dir = location.getDirection();
                block.setVelocity(dir.multiply(2));
    I just tested it and it will fire a fire block (In this case) in the direction your looking at, it also still has its downwards momentum so it they will shoot in a parabolic arc (like an arrow)
     
  9. Offline

    creepycrafter4

    could you make it so that it throws the block you right-clicked at after /bt (as described in first post)?
    as I am no programmer:D
    btw, it looks nice:) .
    a [diamond] for you :)
     
  10. Offline

    Kidd0Elite

  11. Offline

    creepycrafter4

    ok:)
     

Share This Page