Proper Custom Enchantments abstract class?

Discussion in 'Spigot Plugin Development' started by danablend, May 16, 2016.

  1. So I haven't messed around too much with abstract classes, and I need some help setting up. I need for every of my enchants to extend an abstract Custom Enchantments class, I need it to be so i can retrieve every enchant's max-level, tier, lore-name and maybe also an enum or something, I'm not sure how to set it up, I tried the following code, but I don't know how it's going to work:
    Code (Text):
    public abstract class CustomEnchantment {
        private int maxLevel;
        private String tier;
        private String lore;
        public CustomEnchant(int maxLevel, String tier, String lore) {
            this.maxLevel = maxLevel;
            this.tier = tier;
            this.lore = lore;
        public abstract void run();

        public int getMaxLevel() {
            return maxLevel;

        public String getTier() {
            return tier;

        public String getLore() {
            return lore;
  2. Um just something I noticed is for the lore it should be a List<String> not a string