1.15.2 Event getting called twice.

Discussion in 'Spigot Plugin Development' started by BersamBas, Apr 22, 2020.

  1. Code (Java):
        public void onEnderpearlUse(ProjectileLaunchEvent e) {
            Bukkit.broadcastMessage("a");
            }
        }
    Whenever I throw an enderpearl, this event gets called twice. Anybody know why?
    I also tested with a bow, this event gets called once.

    upload_2020-4-21_23-50-12.png
     
  2. Legoman99573

    Supporter

    • Agree Agree x 1
  3. For now, since it appears to be a bug, you could define a static variable count, ++ it each time it is called, and if it is odd, just return. otherwise do logic
     
    • Agree Agree x 1