Inheritance
Inheritance allows groups to automatically receive permissions from other groups. This powerful feature lets you build hierarchies where higher ranks include all permissions from lower ranks.
How Inheritance Works
When a group inherits from another group (called the "parent"), it automatically receives all of the parent's permissions. This is recursive - if the parent also has parents, those permissions are included too.
# Example hierarchy:
owner
↑ inherits from
admin
↑ inherits from
mod
↑ inherits from
vip
↑ inherits from
default
# A player in "admin" has permissions from:
# - admin (direct)
# - mod (inherited)
# - vip (inherited through mod)
# - default (inherited through vip)Setting Up Inheritance
| Command | Description |
|---|---|
/hp group addparent <group> <parent> | Add inheritance |
/hp group removeparent <group> <parent> | Remove inheritance |
# Make VIP inherit from default
/hp group addparent vip default
# Make mod inherit from VIP
/hp group addparent mod vip
# Make admin inherit from mod
/hp group addparent admin modInheritance Visualization
Here's a visual representation of a typical server hierarchy:
┌─────────┐
│ owner │ weight: 100
└────┬────┘
│ inherits
┌────┴────┐
│ admin │ weight: 90
└────┬────┘
│ inherits
┌────┴────┐
│ mod │ weight: 50
└────┬────┘
│ inherits
┌──────────┴──────────┐
│ │
┌────┴────┐ ┌─────┴────┐
│ vip │ │ helper │
│ wt: 20 │ │ wt: 30 │
└────┬────┘ └─────┬────┘
│ │
└──────────┬──────────┘
│ both inherit
┌────┴────┐
│ default │ weight: 0
└─────────┘Multiple Parents
A group can inherit from multiple parent groups. This is useful for combining different permission sets:
# Mod inherits from both vip (donor perks) and helper (staff basics)
/hp group addparent mod vip
/hp group addparent mod helper
# Mod now has permissions from:
# - mod (direct)
# - vip (parent)
# - helper (parent)
# - default (inherited through both)Inheritance Resolution Order
When multiple sources have the same permission, HyperPerms resolves in this order:
- Direct permission on the group - Highest priority
- Parent groups by weight - Higher weight parent wins
- Recursive parent permissions - Depth-first search
# Example conflict resolution:
# - mod has "chat.color: true" directly
# - vip (parent, weight 20) has "chat.color: false"
# - helper (parent, weight 30) has "chat.color: true"
# Result: mod gets "chat.color: true" (direct permission wins)Overriding Inherited Permissions
You can override inherited permissions by setting them directly on the child group:
# VIP has teleport.* (all teleport permissions)
/hp group addpermission vip teleport.* true
# VIP+ inherits from VIP, but we want to deny teleport.player
/hp group addpermission vip+ teleport.player false
# VIP+ has:
# - teleport.* from VIP (inherited)
# - teleport.player: false (direct, overrides inherited)Circular Inheritance Prevention
HyperPerms automatically prevents circular inheritance, where groups would inherit from each other in a loop:
# This would create a loop:
/hp group addparent admin mod
/hp group addparent mod admin # ERROR: Would create circular inheritance
# The second command will be rejectedWeight and Priority
Group weight affects how inheritance conflicts are resolved and which prefix/suffix is displayed. Higher weight = higher priority.
# Player is in both "mod" (weight 50) and "vip" (weight 20)
# When displaying prefix, the "mod" prefix is shown (higher weight)
# When resolving conflicting permissions from parents:
# Higher-weight parent's permission takes precedenceLearn more in the weight guide.
Best Practices
Simple Linear Hierarchy
For most servers, a simple chain works best:
default → vip → mod → admin → owner
Each rank inherits from the one below, gaining all its permissions.Separate Tracks
For complex setups, keep staff and donor tracks separate:
Staff track:
default → helper → mod → admin → owner
Donor track:
default → vip → vip+ → mvp
Players can be in groups from both tracks simultaneously.Avoid Deep Nesting
Deep inheritance chains can be hard to debug. Try to keep inheritance to 3-4 levels maximum.
Document Your Structure
Use the web editor's visual view or create a diagram of your inheritance structure for reference.
Debugging Inheritance
If permissions aren't working as expected:
# Check the group's full info including parents
/hp group info <group>
# Enable verbose mode to see permission resolution
/hp verbose
# Check a specific permission check
/hp check <player> <permission>Example: Complete Server Setup
# Create the groups
/hp group create vip
/hp group create helper
/hp group create mod
/hp group create admin
/hp group create owner
# Set weights
/hp group setweight default 0
/hp group setweight vip 20
/hp group setweight helper 30
/hp group setweight mod 50
/hp group setweight admin 90
/hp group setweight owner 100
# Set up inheritance
/hp group addparent vip default
/hp group addparent helper default
/hp group addparent mod vip
/hp group addparent mod helper
/hp group addparent admin mod
/hp group addparent owner admin
# Now:
# - default: basic permissions
# - vip: default + donor perks
# - helper: default + helper tools
# - mod: vip + helper + mod tools (has both parent chains)
# - admin: mod + admin tools
# - owner: admin + owner toolsSee Also
- Groups - Creating and managing groups
- Weight - How weight affects inheritance
- Permissions - Permission basics
- First Setup - Setting up a basic hierarchy