Load Chunk if minecart near

Discussion in 'Spigot Plugin Development' started by WuK, Apr 15, 2017.

  1. WuK

    WuK

    I have a problem. I set the UnloadChuckEvent to cancelled true. But the minecarts stops. The minecart get every tick their velocity*3.
     
  2. What exactly are you trying to achieve? Examples please?
    That might help us understand your issue.
     
  3. WuK

    WuK

    I make a train plugin. I spawn 4 entities with 2 blocks distance. When the train drives away, he stops at some point in the future.
     
    • Like Like x 1
  4. WuK

    WuK

    Code (Text):
        @EventHandler
        public void unload(ChunkUnloadEvent e){
            e.setCancelled(true);
        }
    That's it. But my minecarts stops after 150-200 blocks.
     
  5. WuK

    WuK

    Maybe I cant set the FakePlayer in the first minecart?
    But how I create them?
     
  6. I am not sure, sorry :(
    My advice would be looking into the documentation, or even taking an existing fake player plugin and decompiling it using JD_GUI. Just make sure you do not break any rules by doing so.
     
    • Like Like x 1
  7. WuK

    WuK

    Can I do it with packets?
     
  8. Why use packets? I mean if that's necessary yeah sure, but why make it this complex? I have one thought however, you set the velocity to velocity*3. See the mistake? Velocity is supposed to be the speed. You're basically increasing speed everytime you tick, and that'll result in a super quick train or something.
     
  9. WuK

    WuK

    I meant the Fake Player. The speed of the train is ok, because the MaxSpeed ist 0,4
     
  10. Ah ok that makes sense. About the fake player, I'd decompile plugins doing similar things and look at the code. However, do it on your own risk. If I were you I'd wait for a few more opinions besides mine.

    Good luck!