Create shotbow flags

Discussion in 'Plugin Development' started by michiletsplay, Oct 30, 2013.

Thread Status:
Not open for further replies.
  1. Hi.
    I want to create a flag like the flags on the shotbow.net-lobby.
    I think they are made using falling sand entities, but Im not sure.

    What are they made of and is there an "easy" way to do this?
     
  2. Offline

    MineDoubleSpace

    They are made with spawning falling blocks, but I don't think there is a easy way to do it.
     
  3. Offline

    NextInLine

    Have a block of sand that respawns in the same place over and over again, put carpet on all sides of it with code, and you're golden. :)
     
  4. Offline

    The_Doctor_123

    michiletsplay NextInLine
    Actually, I'm pretty sure that they're either constantly being teleported or the velocity is constantly set to move slightly in a direction.
     
  5. Offline

    NextInLine

    aye why not both? :p
     
  6. Offline

    The_Doctor_123

  7. Offline

    Goblom

    I can confirm that The_Doctor_123 is somewhat correct. The flags are blocks that are constantly spawning on set times using falling sand. There is no velocity to it.

    Block spawns --> Almost instant despawns then spawns next block in the flag.
     
  8. Goblom I cant figure out how I can spawn a FallingBlock at a not-rounded location.
    I mean that I can spawn one at x: 72.5, but not at x: 72.3
    Or can I?
     
  9. Offline

    MCCoding

    michiletsplay

    I did some testing with setting a falling block to a decimal location but it would just round the decimal off, also to get the falling blocks to stop falling you will need do do something like

    Code:java
    1. getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
    2. public void run(){
    3. FallingBlock fb = Bukkit.getWorld("world").spawnFallingBlock(new Location(Bukkit.getWorld("world"), -296, 67 ,33), Material.WOOL, (byte) 4);
    4. FallingBlock fb2 = Bukkit.getWorld("world").spawnFallingBlock(new Location(Bukkit.getWorld("world"), -296, 66 ,33), Material.WOOL, (byte) 4);
    5.  
    6. fb.remove();
    7. fb4.remove();
    8. }
    9. }, 0, 2L);
    10.  


    Since you can't set the blocks location to a decimal location, you will have to do something like spawn the block every few tick lets say for for example then on the third tick, set the velocity and on the forth tick remove it but i did not have enough time to test it so i'm not sure if in that time the falling blocks had already fallen you will need to test it all.
     
  10. Offline

    AmoebaMan

    MCCoding
    I tried something similar to this where a repeating task with a 1-tick delay would teleport the block to the position and then set its velocity to <0,0,0>. It worked out as far as moving the blocks to the right locations, but the rest was...buggy to say the least. Results included the falling blocks slowly drifting downwards and abruptly jumping back into position (may be client-side), and the falling blocks spontaneously being destroyed after about a minute.
     
Thread Status:
Not open for further replies.

Share This Page