{"record":{"id":"48983094366e5711","repo":"Pumpkin-MC/Pumpkin","slug":"player-does-not-have-enough-permissions","errorCode":null,"errorMessage":"Player does not have enough permissions","messagePattern":"Player does not have enough permissions","errorType":"exception","errorClass":"InventoryError","httpStatus":null,"severity":"warning","filePath":"crates/pumpkin-inventory/src/error.rs","lineNumber":30,"sourceCode":"    /// The specified slot index is invalid or out of bounds.\n    #[error(\"Invalid slot\")]\n    InvalidSlot,\n    /// A player attempted to interact with a container that is closed.\n    ///\n    /// The parameter is the player's entity ID.\n    #[error(\"Player '{0}' tried to interact with a closed container\")]\n    ClosedContainerInteract(i32),\n    /// Multiple players attempted to drag items in the same container simultaneously.\n    #[error(\"Multiple players dragging in a container at once\")]\n    MultiplePlayersDragging,\n    /// Drag operation was performed out of order (e.g., end before start).\n    #[error(\"Out of order dragging\")]\n    OutOfOrderDragging,\n    /// The received inventory packet is malformed or invalid.\n    #[error(\"Invalid inventory packet\")]\n    InvalidPacket,\n    /// The player lacks permission to perform this inventory operation.\n    #[error(\"Player does not have enough permissions\")]\n    PermissionError,\n}\n","sourceCodeStart":12,"sourceCodeEnd":33,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin-inventory/src/error.rs#L12-L33","documentation":"InventoryError::PermissionError is raised when the player lacks the permission required to perform the requested inventory operation (e.g., interacting with a container or using a creative-inventory action they are not allowed to). The library throws it as an authorization gate before mutating inventory state, mirroring vanilla server behavior that rejects unauthorized interactions.","triggerScenarios":"A non-op/non-creative player sends a creative inventory action packet; a player interacts with a container or performs an inventory operation whose required permission (e.g., gamemode/interaction permission) they do not hold; a server plugin restricts container access and the check fails.","commonSituations":"Survival-mode clients sending creative-screen packets (common with hacked clients); server operators restricting container access via permissions while players attempt it anyway; misconfigured permission groups that unintentionally remove inventory interaction permissions.","solutions":["Check the player's gamemode/permission before sending inventory-affecting actions; only clients in creative may send creative inventory packets.","If legitimate players are blocked, grant the required permission in your permissions plugin/configuration.","If you are writing a plugin, gate your own inventory interactions behind the same permission check so you fail fast with a clear message.","For hostile clients, treat the error as a protocol abuse signal and consider kicking or logging the player."],"exampleFix":"// before: allowing the action then hitting the error\nplayer.handle_inventory_click(packet);\n// after: pre-check permission\nif !player.has_permission(\"inventory.interact\") {\n    player.send_message(\"You cannot do that\");\n    return;\n}\nplayer.handle_inventory_click(packet);","handlingStrategy":"validation","validationCode":"// Rust: pre-check the permission\nif !player.has_permission(\"inventory.interact\") {\n    player.send_system_message(\"You lack permission for this action\");\n    return;\n}","typeGuard":"fn can_interact(player: &Player) -> bool { player.has_permission(\"inventory.interact\") }","tryCatchPattern":"match op.run(player) {\n    Err(InventoryError::PermissionError) => player.send_system_message(\"Not allowed\"),\n    Err(e) => return Err(e.into()),\n    Ok(()) => {}\n}","preventionTips":["Check gamemode/permissions before opening or interacting with containers","Audit permission group configs so legitimate roles keep inventory permissions","Log repeated PermissionError events as possible hacked-client signals"],"tags":["minecraft","inventory","permissions","authorization"],"backgroundTag":"insufficient-permissions","analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}