Add a per-player permission to be ignored by mobs #748
Answered
by
YouHaveTrouble
craftish37
asked this question in
__Dismissed__
-
Add a perm - something like purpur.bypass-agresivity.mobname - that will allow players to be ignored by mobs Didn’t find any plugin that can permit that, so I think that could be a good idea 👀 |
Beta Was this translation helpful? Give feedback.
Answered by
YouHaveTrouble
Dec 31, 2021
Replies: 2 comments 1 reply
-
This would be a super simple plugin to make public final class TestPlugin extends JavaPlugin {
@Override
public void onEnable() {
getServer().getPluginManager().registerEvents(new Listener() {
@EventHandler
public void on(EntityTargetEvent event) {
if (event.getTarget() instanceof Player player && player.hasPermission("target.bypass." + event.getEntityType().getKey().getKey())) {
event.setCancelled(true);
}
}
}, this);
}
} Permissions would use the mojang names for mobs:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Implemented in PurpurExtras |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
granny
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implemented in PurpurExtras