Package org.bukkit.permissions
Interface Permissible
- All Superinterfaces:
ServerOperator
- All Known Subinterfaces:
AbstractArrow
,AbstractHorse
,AbstractSkeleton
,AbstractVillager
,Ageable
,Allay
,Ambient
,Animals
,AreaEffectCloud
,ArmorStand
,Arrow
,Axolotl
,Bat
,Bee
,Blaze
,BlockCommandSender
,BlockDisplay
,Boat
,Boss
,Breedable
,Breeze
,Camel
,Cat
,CaveSpider
,ChestBoat
,ChestedHorse
,Chicken
,Cod
,CommandMinecart
,CommandSender
,ComplexEntityPart
,ComplexLivingEntity
,ConsoleCommandSender
,Cow
,Creature
,Creeper
,Damageable
,Display
,Dolphin
,Donkey
,DragonFireball
,Drowned
,Egg
,ElderGuardian
,EnderCrystal
,EnderDragon
,EnderDragonPart
,Enderman
,Endermite
,EnderPearl
,EnderSignal
,Enemy
,Entity
,Evoker
,EvokerFangs
,ExperienceOrb
,Explosive
,ExplosiveMinecart
,FallingBlock
,Fireball
,Firework
,Fish
,FishHook
,Flying
,Fox
,Frog
,Ghast
,Giant
,GlowItemFrame
,GlowSquid
,Goat
,Golem
,Guardian
,Hanging
,Hoglin
,HopperMinecart
,Horse
,HumanEntity
,Husk
,Illager
,Illusioner
,Interaction
,IronGolem
,Item
,ItemDisplay
,ItemFrame
,LargeFireball
,LeashHitch
,LightningStrike
,LingeringPotion
,LivingEntity
,Llama
,LlamaSpit
,MagmaCube
,Marker
,Minecart
,Mob
,Monster
,Mule
,MushroomCow
,NPC
,Ocelot
,Painting
,Panda
,Parrot
,Phantom
,Pig
,Piglin
,PiglinAbstract
,PiglinBrute
,PigZombie
,Pillager
,Player
,PolarBear
,PoweredMinecart
,Projectile
,ProxiedCommandSender
,PufferFish
,Rabbit
,Raider
,Ravager
,RemoteConsoleCommandSender
,RideableMinecart
,Salmon
,Sheep
,Shulker
,ShulkerBullet
,Silverfish
,SizedFireball
,Skeleton
,SkeletonHorse
,Slime
,SmallFireball
,Sniffer
,Snowball
,Snowman
,SpawnerMinecart
,SpectralArrow
,Spellcaster
,Spider
,SplashPotion
,Squid
,Steerable
,StorageMinecart
,Stray
,Strider
,Tadpole
,Tameable
,TextDisplay
,ThrowableProjectile
,ThrownExpBottle
,ThrownPotion
,TippedArrow
,TNTPrimed
,TraderLlama
,Trident
,TropicalFish
,Turtle
,Vehicle
,Vex
,Villager
,Vindicator
,WanderingTrader
,Warden
,WaterMob
,WindCharge
,Witch
,Wither
,WitherSkeleton
,WitherSkull
,Wolf
,Zoglin
,Zombie
,ZombieHorse
,ZombieVillager
- All Known Implementing Classes:
PermissibleBase
Represents an object that may be assigned permissions
-
Method Summary
Modifier and TypeMethodDescriptionaddAttachment
(Plugin plugin) Adds a new emptyPermissionAttachment
to this objectaddAttachment
(Plugin plugin, int ticks) Temporarily adds a new emptyPermissionAttachment
to this objectaddAttachment
(Plugin plugin, String name, boolean value) Adds a newPermissionAttachment
with a single permission by name and valueaddAttachment
(Plugin plugin, String name, boolean value, int ticks) Temporarily adds a newPermissionAttachment
with a single permission by name and valueGets a set containing all of the permissions currently in effect by this objectboolean
hasPermission
(String name) Gets the value of the specified permission, if set.boolean
hasPermission
(Permission perm) Gets the value of the specified permission, if set.boolean
isPermissionSet
(String name) Checks if this object contains an override for the specified permission, by fully qualified nameboolean
isPermissionSet
(Permission perm) Checks if this object contains an override for the specifiedPermission
void
Recalculates the permissions for this object, if the attachments have changed values.void
removeAttachment
(PermissionAttachment attachment) Removes the givenPermissionAttachment
from this objectMethods inherited from interface org.bukkit.permissions.ServerOperator
isOp, setOp
-
Method Details
-
isPermissionSet
Checks if this object contains an override for the specified permission, by fully qualified name- Parameters:
name
- Name of the permission- Returns:
- true if the permission is set, otherwise false
-
isPermissionSet
Checks if this object contains an override for the specifiedPermission
- Parameters:
perm
- Permission to check- Returns:
- true if the permission is set, otherwise false
-
hasPermission
Gets the value of the specified permission, if set.If a permission override is not set on this object, the default value of the permission will be returned.
- Parameters:
name
- Name of the permission- Returns:
- Value of the permission
-
hasPermission
Gets the value of the specified permission, if set.If a permission override is not set on this object, the default value of the permission will be returned
- Parameters:
perm
- Permission to get- Returns:
- Value of the permission
-
addAttachment
@NotNull PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value) Adds a newPermissionAttachment
with a single permission by name and value- Parameters:
plugin
- Plugin responsible for this attachment, may not be null or disabledname
- Name of the permission to attachvalue
- Value of the permission- Returns:
- The PermissionAttachment that was just created
-
addAttachment
Adds a new emptyPermissionAttachment
to this object- Parameters:
plugin
- Plugin responsible for this attachment, may not be null or disabled- Returns:
- The PermissionAttachment that was just created
-
addAttachment
@Nullable PermissionAttachment addAttachment(@NotNull Plugin plugin, @NotNull String name, boolean value, int ticks) Temporarily adds a newPermissionAttachment
with a single permission by name and value- Parameters:
plugin
- Plugin responsible for this attachment, may not be null or disabledname
- Name of the permission to attachvalue
- Value of the permissionticks
- Amount of ticks to automatically remove this attachment after- Returns:
- The PermissionAttachment that was just created
-
addAttachment
Temporarily adds a new emptyPermissionAttachment
to this object- Parameters:
plugin
- Plugin responsible for this attachment, may not be null or disabledticks
- Amount of ticks to automatically remove this attachment after- Returns:
- The PermissionAttachment that was just created
-
removeAttachment
Removes the givenPermissionAttachment
from this object- Parameters:
attachment
- Attachment to remove- Throws:
IllegalArgumentException
- Thrown when the specified attachment isn't part of this object
-
recalculatePermissions
void recalculatePermissions()Recalculates the permissions for this object, if the attachments have changed values.This should very rarely need to be called from a plugin.
-
getEffectivePermissions
Gets a set containing all of the permissions currently in effect by this object- Returns:
- Set of currently effective permissions
-