Blocking powertools?
FrankHeijden opened this issue · 7 comments
EssentialsX version (/essentials
):
b530
Server software (/version
):
git-Spigot-93e20b3-e8b6e4f (MC: 1.12.2)
Heya,
Whenever i try to block powertools using WorldGuard or GriefPrevention claims, essentials still let them bypass the block.
I used the command /rg flag {region} blocked-cmds /home,/spawn
for example to block some commands in a worldguard region, but when a user has a powertool of /home
on a block, they are still allowed to process the command.
Is there a way this could be fixed/done?
Thanks 👍
@Drkmaster83 If it is the case that dispatchCommand
doesn't fire a PlayerCommandPreprocessEvent
, then I can see why the two approaches above could make sense. This would allow power tools to respect EssentialsX features like mutes, command cooldowns and social spy, while also letting other plugins block powertools.
However, I prefer the idea of using Player.chat
over firing our own PlayerCommandPreprocessEvent, as I've encountered a few issues where custom events that extend the API are fired without fully implementing the event, causing errors when EssentialsX tries to handle them which are incorrectly traced back to EssentialsX.
@EssentialsX/contributors Thoughts?
@md678685 Yeah, I just didn't know if using dispatchCommand
was purposeful or not, as Player.chat
was used for the command starting with c:
. Just wanted to bring light onto the problem, I did some research and I could probably test with dispatchCommand
and the event.
One thing's for sure, it exists as an issue.
https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/com/earth2me/essentials/EssentialsPlayerListener.java#L633
The problem is when getServer().dispatchCommand(user.getBase(), command) is called, this can be fixed by calling .chat(), as that causes a PlayerCommandPreprocessEvent that WorldGuard catches.
Opinions? @md678685
I guess you could either call a PlayerCommandPreprocessEvent or just leave it how it is.
Any updates on this? I ran into the same issue. I am really looking forward for this to be fixed.
That wouldn’t work, as people could then set a powerfool somewhere else and still execute the powertool
This has now been fixed - you can download the latest version from the build server.