Preventing placing a few blocks, but allowing everything else
garfonzo opened this issue ยท 5 comments
I use PEX for my permission management. I'm trying to set it up so that players can do everything as normal (placing, breaking, interacting, etc.) except I want to restrict the placement of a handful of blocks. For example, I want to stop the placement of Gold Ore, Diamond Ore, and a few others.
With PEX, negation nodes come first, and then regular nodes. So, my pex looks like this:
- -antibuild.place.14
- antibuild.place
However, this doesn't prevent the placing of block 14 - the Gold Ore. How do I go about preventing placing - just placing, I want to allow breaking - of these items?
I should say that I tried using blacklisting too (adding a few ores to the blacklist) and that worked. But it also prevented players from breaking the ore blocks. This is not my goal - I want players to be able to collect all ores, but UNable to place a handful of ores.
Thought I should clarify.
*Edit - accidentally closed the issue, reoponed it.
Unfortunately, you cannot use the negated permission like you have mentioned above. The only way currently to block placing of a certain block is to use the individual permission to allow all the other blocks. Obviously, that is not a realistic solution to your problem.
I will look into adding a feature to the blacklist function to allow placing/breaking individually. This would allow you to do what you want I believe.
Okay, I believe I have something for you. Please try this build: https://github.com/MutinyCraft/AntiBuild-Old/releases/tag/2.9.2
You should delete your AntiBuild directory and let it create a new one. You will notice there are two seperate blacklist sections in the new config. One is for placing and one is for breaking. It should be pretty self explanatory of what they do. In short, if you want to blacklist players from placing stone you just add the ID to the blacklist place section or if you want to blacklist players from breaking stone you add the ID to the blacklist break section. The permission nodes were changed to antibuild.blacklist.break
, antibuild.blacklist.break.[ID]
, antibuild.blacklist.place
, and antibuild.blacklist.place.[ID]
. You would only need the permissions if you want to allow a player to bypass the blacklist check.
Remember to also set Blacklist-On: true
.
Brilliant! I just did some preliminary testing with this latest build and it works exactly as I had hoped. I will test more later tonight to make sure its doing what I had hoped. But, so far, blacklisting the placement of items works, and bypassing the blacklist placing works with the new permission node. I will try to report back later after thorough testing.
Its great to have a developer so quick to respond and adjust the plugin to meet a user's needs. Thanks!