msemtex 6 Posted November 4, 2021 Hi all, Does anyone have any advice or link to a simple tutorial to create a custom listener? I'm looking to implement a listener that detects a nearby player, the event would be captured in the main script along the lines of a player detected method: public class Script extends AbstractScript implements PlayerListener { @Override public void playerDetected(Player player) { // do stuff based on the detected player } }
Axolotl 31 Posted November 5, 2021 You can get this quite simply like so: List<Player> allPlayers = Players.all(); if(allPlayers.size() > 1) //always atleast 1 cause of localPlayer { }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.