1.15.2 Need help telling Server or World Guard Players Actual Location.

Discussion in 'Spigot Plugin Development' started by zackatack108, Feb 17, 2020.

  1. Okay so I've come across an interesting problem that I know what's causing the problem but the solution seems to be a little tricky.

    Problem:
    I have three plugins involved with the problem Train Carts, Open Audio, and World guard. I am making this ride called the Carousel of Progress that we have setup to rotate between the different scenes with train carts. When the ride rotates between the different scenes the player is moved into a world guard region that is used to play audio through Open Audio.
    So the problem I'm having is when a player is sitting in the train carts seat the train carts plugin thinks players are located in the middle of the attraction where the "cart" spawned from. However because of how big my cart is the player is actually located inside one of the regions that we have created.
    I have already figured out a way to get the players actual location from the Train carts plugin but what I am unable to figure out is sending that location either back to the server or to world guard so the open audio plugin can play the correct audio when the player is actually in the region when sitting down.

    Here's an Image of test situation:
    Red: World guard region
    Blue: Where the "cart" spawns
    Image Link if it doesn't show: https://drive.google.com/uc?id=1N2YLbihIQu-HWvY1MKRVSSsu8qNvYCmG

    [​IMG]