Jake's Build Tools

Jake's Build Tools

4.5k Downloads

Tools can bypass WorldGuard plugin restrictions

Closed this issue ยท 2 comments

commented

Tools can bypass WorldGuard plugin restrictions

To Reproduce
Steps to reproduce the behavior:

  1. Install WorldGuard and JBT datapack
  2. Set region where player cant do anything
    3.Use chisel or trowel or block wrench on region where you dont have permissions.
  3. See bypass

Expected behavior
I expected that the actions would occur on behalf of the player, but after studying the datapack a little, I realized that everything is done through "commands". And this means that the actions are not performed on behalf of the player, because even coreprotect does not record changes to blocks, etc.

Datapack Version
v3.2.1

Im using paper and 1.21.1

commented

This is sadly a fundamental issue with how coreprotect handles setblock commands. The commands themselves are run from the player's context in this datapack, but I believe that because they're an admin command, they automatically bypass.

From a datapack standpoint, this is not something I can account for, and coreprotect would need to make a change to check who is running the setblock command, and whether they have permission before allowing/blocking the placement

commented

I understand you and even anticipated such an answer, so I just cut out from the datapack those that bypass the restrictions, thanks for your quick answer