LytraAccessory

Lytra Accessory is a Pocketmine MP Plugin that will add an accessory features like an RPG game to your server

LytraAccessory

LytraAccessory is a Pocketmine MP Plugin that will add an accessory features on your server

Register The Accessory

To register your accessory, you need to make a new yaml file on the plugin_data folder For example the file name is "coolaccessory.yml" Then inside the file, you need to insert a few things:

  1. ID of the accessory [REQUIRED]
    id: "coolaccessory"
    
  2. Item ID (This one will determine the item that will used for the accessory), Supports for Vanilla Items and CustomItemLoader [REQUIRED]
    item-id: "stick"
    
  3. Custom Name (This one will determine the name of your accessory) [OPTIONAL] If you don't insert this, the name of the accessory will be the name of the item id above
    custom-name: "Cool Accessory"
    
  4. Lore (This one will determine the lore of your accessory) [OPTIONAL]
    lore: ["Cool Accessory", "Very Cool"]
    
  5. Damage Multiplier (This one will affect the damage stats of player) If you set it to 100%, then player will have 100% more damage If you set it to an integer like 1, then player will have 100% more damage 1 = 100%, 2 = 200%, 3 = 300%, etc
    damage-multiplier: 100%
    
    damage-multiplier: 1
    
  6. HP Multiplier (This one will affect the health stats of player) If you set it to 100%, then player will have 100% more hp If you set it to an integer like 1, then player will have 100% more hp 1 = 100%, 2 = 200%, 3 = 300%, etc
    hp-multiplier: 100%
    
    hp-multiplier: 1
    

After that, you need to go to config.yml file, then add your file name to the loaded-accessory

loaded-accessory: ["coolaccessory.yml"]

Commands

CommandDescriptionUsage
/laView your accessory inventory/la
/la getGet an accessory/la get [string:id] [int:amount]
/la giveGive an accessory to another player/la give [string:player] [string:id] [int:amount]
/la infoGet an information about a spesific accessory/la info [string:id]
/la removeRemove an equipped accessory from player/la remove [string:player] [string:id]
/la viewView an accessory inventory of another player/la view [string:player]
/la slots viewDisplay information about total slots and empty slots of player/la slots view [string:player]
/la slots addAdd a spesific amount of slots on accessory inventory/la slots add [string:player] [int:amount]
/la slots removeRemove a spesific amount of slots on accessory inventory/la slots remove [string:player] [int:amount]
/la slots setSet a spesific amount of slots on accessory inventory/la slots set [string:player] [int:amount]

Permissions

You can use lytraaccessory.command.admin permission to give players all the lytra accessory commands permissions

CommandPermissionsDefault
/lalytraaccessory.command.useTrue
/la getlytraaccessory.command.admin.getOP
/la givelytraaccessory.command.admin.giveOP
/la infolytraaccessory.command.admin.infoOP
/la removelytraaccessory.command.admin.removeOP
/la viewlytraaccessory.command.admin.viewOP
/la slots viewlytraaccessory.command.admin.slots.viewOP
/la slots addlytraaccessory.command.admin.slots.addOP
/la slots removelytraaccessory.command.admin.slots.removeOP
/la slots setlytraaccessory.command.admin.slots.setOP

For Developers

Importing the LytraAccessory main file

use FresherGAMING\LytraAccessory\LytraAccessory;

If you want to get the registered accessory

$id = //your accessory id
$amount = //the amount of the accessory do you want to get
LytraAccessory::getInstance()->getAccessory($id, $amount);

If you want to give an accessory to a player

$player = //needs to be a player type not a string
$id = //your accessory id
$amount = //the amount of the accessory do you want to give to the player
LytraAccessory::getInstance()->giveAccessory($player, $id, $amount);

If you want to add an accessory to a player (simply make the player used an accessory)

$player = //needs to be a player type not a string
$id = //your accessory id
LytraAccessory::getInstance()->addAccessory($player, $id);

If you want to remove an accessory from a player (simply make the player take of an accessory)

$player = //needs to be a player type not a string
$id = //your accessory id
LytraAccessory::getInstance()->removeAccessory($player, $id);

If you want to get the number of players accessory slots

$player = //needs to be a player type not a string
LytraAccessory::getInstance()->getSlots($player);

If you want to get the number of players empty accessory slots

$player = //needs to be a player type not a string
LytraAccessory::getInstance()->getAvailableSlots($player);

If you want to set the number of players accessory slots

$player = //needs to be a player type not a string
LytraAccessory::getInstance()->setSlots($player);

Details

Version: 1.0.0

Downloads: 236

Updated: 11/22/2023

Supported API versions: 5.0.0 to 5.27.1

Categories: Mechanics

License: GPL-3.0

Producers

Collaborator