Kicking a player from a mount, such as a pig

Discussion in 'Spigot Plugin Development' started by PieOverload, May 26, 2017.

  1. I plan on creating a plugin that patches a growing issue on some servers. When using timer, you can go really fast on pretty much any mount. I want to create a plugin that would fix this issue, but I'm having trouble with how I would go about kicking the player from the mount once a player is detected using this form of speed. This is probably very simple to do, but I can't, for the life of me, figure it out.
  2. md_5

    Administrator Developer

  3. ScarabCoder

    ScarabCoder Retired Resource Staff

    If the player velocity is over a certain amount (use a bit of math or math libraries) check if the player is on a vehicle, and if so use removePassenger(player) on the vehicle.
    • Like Like x 1
  4. upload_2017-5-25_23-1-25.png
    This is what I have, but I'm relatively new to Java, so I'm not sure how to fix it.

    Attached Files:

  5. not to sound harsh or overly repetitive as others on the forum, but i would highly suggest looking more indepth in some more java tutorials before diving into the spigot api, just by the looks of your provided snip.
  6. Before you touch spigot/bukkit I suggest you learn some sort of basic/intermediate Java.