Solved Runaway Arrow

Discussion in 'Plugin Development' started by Side8StarLite, Jul 22, 2017.

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

    Side8StarLite

    Hello!
    So I'm creating a vehicles plugin, that allows you to spawn in helicopters and tanks and etc that are made up of armorstands and blocks. Each vehicle in turn can do a special ability eg shoot tnt when the passenger right clicks an item, say, gunpowder. I have a helicopter whose special ability is to toggle a hover ability. However, things get a bit funky:
    This is how it looks like the first time you spawn it:
    2017-07-21_23.07.50.png
    This is what it looks like when you ride it (without the hover ability): 2017-07-21_23.07.58.png
    But this is what it looks like when you activate the "hover" ability:
    2017-07-21_23.08.03.png The arrow ends up all the way there!
    It gets even stranger: when I shoot arrows, they shoot as if I'm still on the helicopter:
    2017-07-21_23.08.27.jpg
    I did a Bukkit#broadcast on the arrow's location, but it said that it's in the correct location (under the front of the helicopter)
    If I toggle the hover ability back off, the arrow pops back in place, but then flies back away when I toggle it back on.
    Does anyone know why this is happening?
    Thanks for any advice!
     
  2. Offline

    Zombie_Striker

    @Side8StarLite
    What happens when you toggle the hover ability? Do you have any code to teleport the arrow when this happens? Does the player dismount when that happens?
     
  3. Offline

    Side8StarLite

    @Zombie_Striker
    Your second point helped alot! I managed to fix the problem by teleporting the arrow to the location I needed during the hovering ability. It's a dirty and quick solution, but it works! Thanks for the help
     
  4. Offline

    Zombie_Striker

    @Side8StarLite
    If your problem has been solved, mark this thread as solved.
     
Thread Status:
Not open for further replies.

Share This Page