Grief Prevention

Grief Prevention

1M Downloads

CommandsRequiringAccessTrust Not Working – Players Can Still Set Home in Claims

KnightWorldfr opened this issue · 2 comments

commented

Observed Behavior

It seems that CommandsRequiringAccessTrust is not working properly. My players can still use /sethome inside a claim, even if they don’t have the required trust level.

Steps to Reproduce
Running Minecraft version 1.21.4

In my config, I set:
CommandsRequiringAccessTrust: /sethome

I tested with additional commands:
CommandsRequiringAccessTrust: /sethome, /esethome, /essentials:sethome

When a player without AccessTrust runs /sethome, they receive the message:
"You do not have permission to XXX to do that."

However, the home still gets set anyway.

Expected Behavior
The command /sethome should be blocked entirely if the player lacks AccessTrust.

Actual Behavior
Players receive a denial message but can still set their home.

Expected Behavior

Expected Behavior
The command /sethome should be blocked entirely if the player lacks AccessTrust.

Reproduction steps

In my config, I set:
CommandsRequiringAccessTrust: /sethome

I tested with additional commands:
CommandsRequiringAccessTrust: /sethome, /esethome, /essentials:sethome

Stack trace or error log

no error in console

Server version

[20:01:39 INFO]: This server is running Paper version 1.21.4-78-main@49d15f6 (2025-01-07T18:45:42Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)
You are 69 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
Previous version: 1.21.4-76-486e521 (MC: 1.21.4)

GriefPrevention version

version GriefPrevention
[20:02:01 INFO]: GriefPrevention version 16.18.4

Configuration

# Default values are perfect for most servers.  If you want to customize and have a question, look for the answer here first: http://dev.bukkit.org/bukkit-plugins/grief-prevention/pages/setup-and-configuration/

GriefPrevention:
  SeaLevelOverrides:
    Spawn: -1
    Casino: -1
    Nether: -1
    ZonePVP: -1
    Event: -1
    Survie: -1
    KnightQuest: -1
    Minage: -1
    ZoneAFK: -1
  Claims:
    Mode:
      Nether: Disabled
      KnightQuest: Disabled
      Minage: Disabled
      Survie: Survival
      ZonePVP: Disabled
      Event: Disabled
      ZoneAFK: Disabled
      Spawn: Disabled
      Casino: Disabled
    PreventGlobalMonsterEggs: true
    PreventTheft: true
    ProtectCreatures: true
    PreventButtonsSwitches: true
    LockWoodenDoors: false
    LockTrapDoors: true
    LockFenceGates: true
    EnderPearlsRequireAccessTrust: true
    RaidTriggersRequireBuildTrust: true
    ProtectHorses: true
    ProtectDonkeys: true
    ProtectLlamas: true
    InitialBlocks: 2000
    Claim Blocks Accrued Per Hour:
      Default: 0
    Max Accrued Claim Blocks:
      Default: 80000
    Accrued Idle Threshold: 0
    AccruedIdlePercent: 0
    AbandonReturnRatio: 1.0
    AutomaticNewPlayerClaimsRadius: -1
    AutomaticNewPlayerClaimsRadiusMinimum: 0
    ExtendIntoGroundDistance: 5
    MinimumWidth: 6
    MinimumArea: 256
    MaximumDepth: -64
    InvestigationTool: STICK
    ModificationTool: GOLDEN_SHOVEL
    Expiration:
      ChestClaimDays: 182
      UnusedClaimDays: 182
      AllClaims:
        DaysInactive: 182
        ExceptWhenOwnerHasTotalClaimBlocks: 10000
        ExceptWhenOwnerHasBonusClaimBlocks: 10000
      AutomaticNatureRestoration:
        SurvivalWorlds: false
    AllowTrappedInAdminClaims: false
    MaximumNumberOfClaimsPerPlayer: 1
    CreationRequiresWorldGuardBuildPermission: true
    VillagerTradingRequiresPermission: true
    CommandsRequiringAccessTrust: /sethome, /esethome, /essentials:sethome
    DeliverManuals: false
    ManualDeliveryDelaySeconds: -1
    RavagersBreakBlocks: false
    FireSpreadsInClaims: false
    FireDamagesInClaims: true
    LecternReadingRequiresAccessTrust: true
  Spam:
    Enabled: false
    LoginCooldownSeconds: 30
    LoginLogoutNotificationsPerMinute: 5
    ChatSlashCommands: /me;/global;/local
    WhisperSlashCommands: /tell;/pm;/r;/whisper;/msg
    WarningMessage: Please reduce your noise level.  Spammers will be banned.
    BanOffenders: true
    BanMessage: Banned for spam.
    AllowedIpAddresses: 1.2.3.4; 5.6.7.8
    DeathMessageCooldownSeconds: 120
    Logout Message Delay In Seconds: 0
  PvP:
    RulesEnabledInWorld:
      Spawn: false
      Casino: false
      Nether: true
      ZonePVP: true
      Event: true
      Survie: true
      KnightQuest: false
      Minage: true
      ZoneAFK: false
    ProtectFreshSpawns: true
    PunishLogout: true
    CombatTimeoutSeconds: 15
    AllowCombatItemDrop: true
    BlockedSlashCommands: /home;/vanish;/spawn;/tpa
    ProtectPlayersInLandClaims:
      PlayerOwnedClaims: true
      AdministrativeClaims: true
      AdministrativeSubdivisions: true
    AllowLavaDumpingNearOtherPlayers:
      PvPWorlds: true
      NonPvPWorlds: false
    AllowFlintAndSteelNearOtherPlayers:
      PvPWorlds: true
      NonPvPWorlds: false
    ProtectPetsOutsideLandClaims: false
  Economy:
    ClaimBlocksMaxBonus: 0
    ClaimBlocksPurchaseCost: 0.0
    ClaimBlocksSellValue: 0.0
  ProtectItemsDroppedOnDeath:
    PvPWorlds: false
    NonPvPWorlds: false
  BlockLandClaimExplosions: true
  BlockSurfaceCreeperExplosions: true
  BlockSurfaceOtherExplosions: true
  LimitSkyTrees: true
  LimitTreeGrowth: false
  PistonMovement: CLAIMS_ONLY
  PistonExplosionSound: true
  FireSpreads: false
  FireDestroys: false
  AdminsGetWhispers: false
  AdminsGetSignNotifications: false
  VisualizationAntiCheatCompatMode: false
  SmartBan: true
  Mute New Players Using Banned Words: false
  MaxPlayersPerIpAddress: 3
  SilenceBans: true
  Siege:
    Worlds: []
    BreakableBlocks:
    - GRASS_BLOCK
    - DIRT
    - COBBLESTONE
    - OAK_PLANKS
    - SPRUCE_PLANKS
    - BIRCH_PLANKS
    - JUNGLE_PLANKS
    - ACACIA_PLANKS
    - DARK_OAK_PLANKS
    - SAND
    - GRAVEL
    - GLASS
    - GRASS     <-- can't understand this entry, see BukkitDev documentation
    - FERN
    - DEAD_BUSH
    - WHITE_WOOL
    - ORANGE_WOOL
    - MAGENTA_WOOL
    - LIGHT_BLUE_WOOL
    - YELLOW_WOOL
    - LIME_WOOL
    - PINK_WOOL
    - GRAY_WOOL
    - LIGHT_GRAY_WOOL
    - CYAN_WOOL
    - PURPLE_WOOL
    - BLUE_WOOL
    - BROWN_WOOL
    - GREEN_WOOL
    - RED_WOOL
    - BLACK_WOOL
    - SNOW
    - GLASS_PANE
    DoorsOpenDelayInSeconds: 300
    CooldownEndInMinutes: 60
  EndermenMoveBlocks: false
  SilverfishBreakBlocks: false
  CreaturesTrampleCrops: false
  RabbitsEatCrops: true
  HardModeZombiesBreakDoors: false
  MobProjectilesChangeBlocks: false
  Database:
    URL: ''
    UserName: ''
    Password: ''
  UseBanCommand: false
  BanCommandPattern: ban %name% %reason%
  Advanced:
    fixNegativeClaimblockAmounts: true
    ClaimExpirationCheckRate: 60
    OfflinePlayer_cache_days: 90
  Abridged Logs:
    Days To Keep: 7
    Included Entry Types:
      Social Activity: true
      Suspicious Activity: true
      Administrative Activity: false
      Debug: false
      Muted Chat Messages: false
  ConfigVersion: 1

Plugin list

pl
[20:02:23 INFO]: Server Plugins (90):
[20:02:23 INFO]: Paper Plugins:
[20:02:23 INFO]: - CrazyCrates, EconomyShopGUI-Premium
[20:02:23 INFO]: Bukkit Plugins:
[20:02:23 INFO]: - AdvancedBan, AFKPlus, Anticraft, AntiElytraBoost, ArmorStandTools, AzLink, BeautyQuests, BetterRTP, BossBarHealth, BottledExp
[20:02:23 INFO]: BuilderMode, Captcha, ChatManager, ChestCleaner, Chunky, CinematicView, Citizens, ClearLag, CMILib, ConsoleFilter
[20:02:23 INFO]: CoreProtect, CrateReloaded, CrazyAuctions, DailyRewards, DecentHolograms, DeluxeMenus, DemiVoteBox, DiscordSRV, DiscordSRV-Staff-Chat, Essentials
[20:02:23 INFO]: EssentialsChat, EssentialsGeoIP, EssentialsSpawn, Freeze, GemsEconomy, GlobalVote, gProtector, GriefPrevention, HeadDatabase, Images
[20:02:23 INFO]: Infiniteannouncements, InfiniteScoreboard, InventoryRollbackPlus, Jump, KickFromClaim, KnightQuest, Lib1711, LoterieValue, LuckPerms, Maintenance
[20:02:23 INFO]: MobFarmManager, Multiverse-Core, Multiverse-Portals, MyCommand, NBTAPI, OldCombatMechanics, OpenInv, Parkour, PlaceholderAPI, PlayerParticles
[20:02:23 INFO]: PluginManager, ProtocolLib, *Sentry, SimplePortals, SimpleTpa, Skill, Skript, SpawnerMeta, SuperVanish, TAB
[20:02:23 INFO]: TetePack, TeteSecret, TigerReports, TigerReportsSupports, TitleCustom, UltimateAntiBot, Uprank, Vault, ViaBackwards, ViaVersion
[20:02:23 INFO]: ViewDistanceTweaks, VoidChest, VoteFly, WorldBorder, WorldEdit, WorldEditSelectionVisualizer, WorldGuard, WorldGuardExtraFlags

Running without GriefPrevention

  • I attempted running the server without GriefPrevention installed.
  • The problem does not occur when GriefPrevention is removed from the server.

Running with only GriefPrevention

  • I attempted running only GriefPrevention on the server.
  • The issue still occurs when GriefPrevention is the only plugin running.

Running on a fresh, clean server installation

  • I attempted testing for the issue on a new server.
  • The issue still occurs on a new server.

Using unmodified client

  • I attempted testing for the issue with the vanilla client.
  • The issue still occurs when using the vanilla client.

We appreciate you taking the time to fill out a bug report!

  • I searched for similar issues before submitting this bug report.
commented

Sounds like either a server implementation issue (not respecting event cancellation) or another plugin un-cancelling the event. If GP sends the access trust denial message, GP cancels the event.

if (accessTrustCommands.isMonitoredCommand(command))
{
Claim claim = this.dataStore.getClaimAt(player.getLocation(), false, playerData.lastClaim);
if (claim != null)
{
playerData.lastClaim = claim;
Supplier<String> reason = claim.checkPermission(player, ClaimPermission.Access, event);
if (reason != null)
{
GriefPrevention.sendMessage(player, TextMode.Err, reason.get());
event.setCancelled(true);
}
}
}

commented

I'd recommend using this instead https://modrinth.com/plugin/qgp-contexts (requires LuckPerms)

This will let you use permission based denials which wont get uncancelled.
In my example setup, I showcased /sethome for essentials

Image
This will work for any permission, and has a lot of flexibility, and you can even respect trust levels, not a flat out denial like GP does.