RPG plugin for Spigot
RPGfy is a spigot plugin that adds a compendium of RPG elements to minecraft.
Features:
Upcoming features (in order of priority):
Gives a custom weapon or armor to the caller
/spawngear <custom_item_name>
/spawngear armor <type> <name> <armor?> <armor_toughness?> <effect1?> <value1?> ... <effectN?> <valueN?>
/spawngear weapon <type> <name> <damage?> <attack_speed?> <effect1?> <value1?> ... <effectN?> <valueN?>
example:
/spawngear armor helmet Cap 10 5 Repel 2
Would generate a helmet with name “Cap”, 10 armor, 5 armor toughness and repel effect
(Parameters marked with “?” are optional)
Shows a list of current registered effects or custom items
/list <effects/items>
Edit the droptable.yml file located in the plugins/RPGfy folder to
add custom droptables to entities.
Each entry must look like this:
<mobname>:
drop:
item1:
name: <itemname1>
dropchance: <dropchancePercentage1>
item2:
name: <itemname2>
dropchance: <dropchancePercentage2>
See droptable.yml for a real example
Supported item traits
Trait | Description | Bounds | Default | Required |
---|---|---|---|---|
name | Name of the item | - | Defaults to the type of the item | No |
type | Must match the name of a custom item or a MATERIAL, example: DIAMOND_SWORD, MyCustomArmor | - | Nothing, the item won’t be created | Yes |
dropchance | Drop chance of the item specified as percentage, example: 0.01, 1, 10 | 1.0E-16 - 100 | Nothing, item won’t be created | Yes |
minQuantity | Minimum amount of item that will drop if it does drop | 0 - 64 | 0 | No |
maxQuantity | Max amount of item that will drop if it does drop | 1 - 64 | 1 | No |
Custom items are loaded through a config YAML file in the plugin’s configuration folder,
they can be spawned using the /spawngear command or added to a mob’s droptable.
Trait | Description | Accepts | Default | Required |
---|---|---|---|---|
name | Name of the item | Text | Defaults to the type of the item | No |
type | Must match the name of a custom item or a MATERIAL, example: DIAMOND_SWORD, MyCustomArmor | Material or custom item name | Nothing, the item won’t be created | Yes |
lore | Item description | Text | Empty string | No |
effects | Item effects, must match the type of item (an armor effect if items is armor, weapon effect if weapon is a weapon) must be written as a list (see above for an example or in the custom_items.yml) | List of effects | No effects | No |
Trait | Description | Accepts | Default | Required |
---|---|---|---|---|
damage | Weapon damage | 0 - inf | Defaults to the damage of the type of the item | No |
attackSpeed | Delay between attacks in seconds | 0 - inf | Defaults to the attack speed of the type of the item | No |
skin | Weapon skin | Red/White/Grey/Brown/Cyan | Defaults to the weapon’s base skin (usually cyan) | No |
Trait | Description | Accepts | Default | Required |
---|---|---|---|---|
armor | Armor value | 0 - inf | Defaults to the armor’s base value | No |
armor | Armor value | 0 - inf | Defaults to the armor’s base value | No |
For sake of simplicity I used “inf”, but the actual max value is 2,147,483,647 (max integer value).
Displays monster’s health over their head
Documentation in progress
Effects
To create new effects, go to the item/effect/entity/impl and create a new object extending either
WeaponEffect or ArmorEffect, pass the name of the effect to the parent class, and implement
methods. Remember cooldown() and duration() unit is TPS, multiply the seconds you want the
cooldown or duration to last by the constant MinecraftServer.TPS
After you’re done with your effect, go to Rpgfy (main class) and register your effect in the
method registerEffects() just like the rest.
Items
To create new item classes, create a new class extending either Weapon or ArmorPiece.