Check if TeleportCause was caused by MY plugin

Discussion in 'Spigot Plugin Development' started by iGniSs, Jul 29, 2018.

  1. Hello,

    I am checking if teleport was caused by plugins, but how can I check if it was caused by my plugin that is handling this?

    Thanks for help.
  2. I know you can check if it was done by a Plugin by checking if the cause equals to TeleportCause#plugin but I don't think it is possible to check which plugin did it
  3. Benz56

    Moderator Supporter

    Wherever you teleport a player or whatever else set a boolean(true) bound to the entity’s uuid either with a Map reference or a player data object. In the TeleportEvent check for that and then reset it aka. set the value to false.

    This is very basic but certainly is a way to achieve what you need.
    • Agree Agree x 1