Spawn Arrow (HALP)

Discussion in 'Plugin Development' started by Vinceguy1, Jun 22, 2013.

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

    Vinceguy1

    This is my problem



    CODE (open)

    Code:
                    int o = Integer.parseInt(args[1]);
                    Location loc = new Location(Bukkit.getPlayer(args[0]).getWorld(), Bukkit.getPlayer(args[0]).getLocation().getX(), Bukkit.getPlayer(args[0]).getLocation().getY() + 5, Bukkit.getPlayer(args[0]).getLocation().getZ());
                    for(int i = 0; i < o; i++)
                    {
                        Bukkit.getPlayer(args[0]).getWorld().spawn(loc, Arrow.class);
                        try
                        {
                            Thread.sleep(1000);
                        } catch (InterruptedException e)
                        {
                            e.printStackTrace();
                        }
                    }


    See, the arrows need to be delayed so each arrow can hit the player, but if i delay them, they don't hit until they're all spawned anyways, but if they hit all at once, only one arrow hits! help please?

    If anyone can figure this out, they can get a free cookie!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 2, 2016
  2. Offline

    hubeb

    Hoolean likes this.
  3. Offline

    Vinceguy1

    hubeb TY, but i found a different way, cause im lazy

    Video aswell:





    Code Fix (open)

    Code:
                    int o = Integer.parseInt(args[1]);
                    for(int i = 0; i < o; i++)
                    {
                        int p = o * 5;
                        for (int y = 0; y < p; y = y +5)
                        {
                            Location loc = new Location(Bukkit.getPlayer(args[0]).getWorld(), Bukkit.getPlayer(args[0]).getLocation().getX(), Bukkit.getPlayer(args[0]).getLocation().getY() + y, Bukkit.getPlayer(args[0]).getLocation().getZ());
                            Bukkit.getPlayer(args[0]).getWorld().spawn(loc, Arrow.class);
                        }
                    }


    If anyone can figure out a way to spawn them all at once and make all of them hit, i will owe you big time.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 2, 2016
  4. Offline

    hubeb

    use this to make ur code a little be less clunky
    Code:java
    1.  
    2. Player bp = Bukkit.getPlayer(args[0]);
    3. Location loc = (bp.getWorld(),bp.getX(),bp.getY() + y,bp.getZ());
    4. bp[I][FONT=Consolas].getWorld().spawn(loc, Arrow.class);[/FONT][/I]
    5.  
     
  5. Offline

    Vinceguy1

    hubeb i know, i was just messing around and too lazy, thanks though :)
     
  6. Offline

    Eats_Rainbows

    Question - How did you change the respawn screen text to "You kicked the bucket" ?
     
  7. Offline

    Bammerbom

  8. Offline

    Eats_Rainbows

    Watch the video, the death message screen says "You kicked the bucket" ...
     
  9. Offline

    Vinceguy1

    Eats_Rainbows language packs
     
Thread Status:
Not open for further replies.

Share This Page