Lembas-Modding-Team / pvp-mode

A Minecraft mod offering various options to manage availability for and ability to PvP.
GNU Lesser General Public License v3.0
5 stars 3 forks source link

Essentials compatibility module #337

Open DwarfyAssassin opened 5 years ago

DwarfyAssassin commented 5 years ago

In short disable pvp for AFK players. This could be useful because on some server killing players who are AFK is forbidden, this would enforce that rule.

From what I have seen and tested this should work to get if a player is AFK.

Essentials ess = (Essentials) Bukkit.getServer().getPluginManager().getPlugin("Essentials");
ess.getUser(BukkitPlayer).isAfk()
CraftedMods commented 5 years ago

We'll also add an event for canDoPvP, which allows compatbility modules to change the behaviour of that function. See #338