Resource image

ProPerks [1.8-1.17.1]

1.4

Powerful system to enable per player perks to enhance the gameplay of your server!



How to create custom perks?

Three step guide on how to create custom perks:

First you will need to create your own spigot plugin base (extending JavaPlugin and so on), there are plenty tutorials out there so i wont get into detail.

 

Then you need to create a class for your perk.
You can choose any name for the class that you want, the important part is that it needs to extend one of the three possible types of perk "AbstractCommandPerk", "AbstractListenerPerk" or "AbstractEffectPerk":

In this example i choose to extend as an AbstractEffectPerk.
Code (Java):
public class CustomPerk extends AbstractEffectPerk {
public CustomPerk() {
super("advancedPerks.custom", "§6Custom Perk",
Arrays.asList("§7When the perk gets enabled", "§7It will do crazy custom things :o"),
new PotionEffect(PotionEffectType.BLINDNESS, Integer.MAX_VALUE, 0, false, false));
}

@Override
public ItemStack getPerkIcon() {
return new ItemStackBuilder(Material.SUGAR)
.setDisplayName(this.getDisplayName())
.setItemLore(this.getDescription())
.build();
}
}
The method getPerkIcon() tries to return and ItemStack and is mandatory.
The ItemStack that gets returned by that method will define how the perk is represented ingame.

All three types of AbstractPerk classes share the same first three expected constructor parameter:
Code (Java):
(String permission, String displayName, List description, /*perk specific parameter*/)
permission - takes a String which defines the permission that is needed by the player to toggle this perk

displayName - takes a String which defines the identifier for the perk

description - takes a List of String's each String in the list should represent a line in the description of the perk

AbstractCommandPerk
Additionally to the first 3 default parameter it takes the following:
Code (Java):
(List enableCommands, List disableCommands)
The first List will be the commands that gets run by the console when the perk gets enabled.
The second List will be the commands that gets run by the console when the perk gets disabled.

AbstractEffectPerk
Additionally to the first 3 default parameter it takes the following:
Code (Java):
(PotionEffect potionEffect)
The PotionEffect from the constructor will be applied to the player when the perk gets enabled or unapplied when the perk gets disabled.

AbstractListenerPerk
This perk type doesn't take any additional parameter.
This class will automatically be registered by the plugin to listen for events.

 

Said plugin then needs to listen for the PerkRegistryEvent and invoke the method registerPerk() with a new instance of the custom perk as parameter.
Code (Java):
@EventHandler
public void onPerkRegistry(PerkRegistryEvent perkRegistryEvent) {
perkRegistryEvent.registerPerk(new CustomPerk());
}
If everything was successfull the perk should now be part of the perksgui.


/perks data - It will diplay all by the player enabled perks (useful for moderative purposes)
/perks - open perks menu 

 



perks:

#The maximum amount of perks a player can have active at once
#To disable an amount limit set to -1
maxPerks: -1

perksStateStorage:

#The way that the plugin saves the perk data of the players
#You can choose between 'FILE' and 'DATABASE'
type: 'FILE'

#If the type is set to 'FILE' you can specify the path to the
#file which should be used for storing the data
#Changing the file location requires a complete restart
fileLocation: 'plugins/ProPerks/data.db'

sql:

#The connection string for the mysql database to connect to
#Just the connection string (auth is handled below)
connection: 'jdbc:mysql://127.0.0.1:3306/perks?useSSL=false'

#Username of the mysql user (for auth)
username: 'root'

#Password of the mysql user (for auth)
password: 'password'
#Global prefix of the plugin
prefix: '&7[&6ProPerks&7]'

general:
disabledWorld: '{prefix} &cToggling the Perk is disabled in this world!'

commands:
noPermission: '{prefix} &cYou dont have the permission to use that command!'

#Messages related to the default perks and their usage
perks:
tooManyPerks: '{prefix} &cCannot activate Perk the maximum allowed amount of Perks is {0}!'

noPermission: '{prefix} &cYou dont have the permission to use that Perk!'

bat:
displayName: '&o&lBat Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill receive the night vision effect!'

chicken:
displayName: '&f&lChicken Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill not receive any fall damage!'

fireResistance:
displayName: '&c&lFire Resistance Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill receive the fire resistance effect!'

frog:
displayName: '&2&lFrog Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill receive the jump boost II effect.'

hulk:
displayName: '&a&lHulk Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill receive the strength effect!'

keepInventory:
displayName: '&6&lKeep Inventory Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill not loose any items when he dies!'

glowing:
displayName: '&e&lGlowing Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill receive the glowing effect!'

noHunger:
displayName: '&9&lNo Hunger Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill not loose any hunger or saturation!'

poseidon:
displayName: '&b&lPoseidon Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill not drown when he is underwater!'

speed:
displayName: '&f&lSpeed Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill receive the speed effect.'

turtle:
displayName: '&2&lTurtle Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill receive the resistance effect!'

wiser:
displayName: '&e&lWiser Perk'
description:
- '&7&oAs long as the perk is activated the player'
- '&7&owill not loose his xp when he dies!'

dolphin:
displayName: '&9Dolphin Perk'
description:
- '&7&oAs long as the perk is activated the player will get a'
- '&7&osmall boost in the water when he starts to sneak!'

bird:
displayName: '&f&lBird Perk'
description:
- '&7&oWhen activated this perk allows the player to fly even'
- '&7&owhen he is in survival mode.'

#Messages related to the perks gui
perksGui:
#Title of the perks gui
displayName: '&m &f&8[&5Perks&8]&m '

#Messages related to the gui elements of the perks gui
guiElement:

disableAllPerks:
displayName: '&cDisable all Perks'
description:
- '&7&oClick here to disable all activated perks at once!'

closeGui:
displayName: '&cClose Gui'
description:
- '&7&oClick here to close the gui!'

previousPage:
displayName: '&ePrevious Page'
description:
- '&7&oClick to get to the previous page!'

nextPage:
displayName: '&eNext Page'
description:
- '&7&oClick to get to the next page!'
#This configuration file is used to define properties of the default perks provided
#by the plugin itself

#enabled:
#Whether the plugin should use that perk (other properties like the messages
#needs to be changed in message.yml)
exambleE:
enabled: true

#permission:
#The permission the player need to activate that perk,
#if you don't want the player to need a permission just set the
#permission to ''
exampleP:
permission: 'properks.examplePermission'

#disabledWorlds:
#The names of worlds in which the perk can't be toggled.
#To add worlds:
exampleD:
disabledWorlds:
- 'example1'
- 'example2'

fireResistance:
enabled: true
permission: 'properks.fireResistance'
disabledWorlds: [ ]
glowing:
enabled: true
permission: 'properks.glowing'
disabledWorlds: [ ]
bat:
enabled: true
permission: 'properks.bat'
disabledWorlds: [ ]
chicken:
enabled: true
permission: 'properks.chicken'
disabledWorlds: [ ]
hulk:
enabled: true
permission: 'properks.hulk'
disabledWorlds: [ ]
keepInventory:
enabled: true
permission: 'properks.keepInventory'
disabledWorlds: [ ]
noHunger:
enabled: true
permission: 'properks.noHunger'
disabledWorlds: [ ]
poseidon:
enabled: true
permission: 'properks.poseidon'
disabledWorlds: [ ]
speed:
enabled: true
permission: 'properks.speed'
disabledWorlds: [ ]
turtle:
enabled: true
permission: 'properks.turtle'
disabledWorlds: [ ]
wiser:
enabled: true
permission: 'properks.wiser'
disabledWorlds: [ ]
dolphin:
enabled: true
permission: 'properks.dolphin'
disabledWorlds: [ ]
frog:
enabled: true
permission: 'properks.frog'
disabledWorlds: [ ]
bird:
enabled: true
permission: 'properks.bird'
disabledWorlds: [ ]

Terms of Service (you agree to, by buying/downloading this plugin):
  • You are responsible what happens with the plugin after you download, therefore, if plugin is leaked or redistributed and it's registered under your name, I am allowed to remove you from buyers list without a warning. I may be obligated to report you on SpigotMC, which might lead to your account being permanently suspended (banned).
  • You may not redistribute plugin, in any shape or form neither it's code or parts of it.
  • You may ask me for support if plugin doesn't function the way it's supposed to.
  • No refunds, all payments are final as by buying you gain access to this resource without ability to stop it.
More information about the plugin is provided in configuration files

(you will have to go through buyer verification process before getting accepted for support, if you don't have access to "Download" button here don't even bother joining and begging for help or bothering users via PM)
Information
Author chochoco4777
Total downloads 1
First Release 08 Oct. 2021
Last Update 08 Oct. 2021
Category Fun
All-time rating
Version 1.4
Released 08 Oct. 2021
Downloads 1
Version rating
0 ratings
More resources from chochoco4777
Resource logo

With ItemStack Support! - Make the MultiSpawner drop when you silk them (permission based)

Resource logo

Unlimited backpacks options | Custom backpacks | Backpacks Recipe

Resource logo

High performance and customizable Battle Pass plugin.

Resource logo

Jump between blocks in this unique sky grid world; Can you survive & thrive?

Resource logo

give the ability to your players to get vaults for win your games, and get reward open a Vault!