Created
May 15, 2021 14:24
-
-
Save Geolykt/44886cfe0f0c6e15559fc4e6d30e6149 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DIJavaPlugin extends JavaPlugin { | |
public void onEnable() { | |
getServer().getPluginManager().registerEvents(new Child(this), this); | |
} | |
} class Child implements Listener { | |
private final JavaPlugin parentPlugin; | |
public Child(JavaPlugin pl) { | |
parentPlugin = pl; | |
} | |
public void onEvent(Event e) { | |
Bukkit.getServer().getScheduler().runTaskLater(parentPlugin, () -> { | |
// Your code | |
}, delayInTicks); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment