Solved HealthBoost Enchantment or Enchantment API

Discussion in 'Plugin Development' started by CoderRex, Feb 16, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    CoderRex

    I Need help with the enchantment api and coding custom enchantments for my server and i want to make enchants like the archons so that i could release for people who dont know how to code and want to use the same thing that they use so then i tried to code a healthboost enchantment
    Here is the Code:
    Code:
    public class Life extends CoustomEnchantment {
    
        public Life(Plugin plugin) {
            super(plugin, EnchantDefaults.LIFE, ItemSets.CHESTPLATES.getItems(), 2);
            description = "Grants bonus health when equipped";
        }
    
        @Override
        public void applyEquipEffect(Player player, int level) {
            player.setMaxHealth(20 + health(level));
            double health = player.getHealth() + health(level);
            if (health > player.getMaxHealth()) health = player.getMaxHealth();
            player.setHealth(health);
        }
    
        @Override
        public void applyUnequipEffect(Player player, int level) {
            player.setMaxHealth(20);
        }
    }
    
    The problem is this wont go in so i need to be able to add a max level
    base and interger and also when i try to start it it gives me a error where the plugin.yml is not found

    this is my plugin.yml
    Code:
    name: ELementEnchants
    author: Rex
    main:me.Rex.Main.Main
    version: 1.0
    description: Custom Enchants
    depend: [EnchantmentAPI]
     
    Last edited: Feb 16, 2016
  2. Offline

    Gerov

    @CoderRex So what's wrong? We aren't going to tell you step by step what to do, you need to tell us specifically what you want.
     
  3. Offline

    CoderRex



    HEre is the problem
    the code for healthbost doesnt work
    when i try trie to start the others it gives and error saying plugin.yl file cannot be found it might be because i captilized Plugin instead of plugin
     
  4. Offline

    Skylandz

    In the plugin.yml you posted, there isn't a space between "main:" and "me.Rex.Main.Main"
     
  5. Offline

    CoderRex

    thx

    --

    this is the error my console gives when i load the plugin

    Could not load 'plugins/ElementsEnchantments (2).jar' in folder 'plugins' org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:154) ~[spigot-1.8.3.jar:git-Spigot-870264a-0a645a2] at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot-1.8.3.jar:git-Spigot-870264a-0a645a2] at org.bukkit.craftbukkit.v1_8_R2.CraftServer.loadPlugins(CraftServer.java:291) [spigot-1.8.3.jar:git-Spigot-870264a-0a645a2] at net.minecraft.server.v1_8_R2.DedicatedServer.init(DedicatedServer.java:199) [spigot-1.8.3.jar:git-Spigot-870264a-0a645a2] at net.minecraft.server.v1_8_R2.MinecraftServer.run(MinecraftServer.java:522) [spigot-1.8.3.jar:git-Spigot-870264a-0a645a2] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72] Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml ... 6 more


    [merged by moderator: please use the Edit button]
     
    Last edited by a moderator: Feb 16, 2016
  6. Offline

    Skylandz

    Have u made the plugin.yml in the right place?
     
  7. Offline

    CoderRex


    where would the right place be, i right clicked and created it out from the file and everything else
     
  8. Offline

    timtower Administrator Administrator Moderator

  9. Offline

    CoderRex

    yeah thats where i put it does it matter if the P in plugin is capitalized
     
  10. Offline

    timtower Administrator Administrator Moderator

    Has to be lowercase.
     
  11. Offline

    CoderRex

    then thats my prob thx mod amd im new and been praticing and studying up this was my second plugin love the bukkit community
     
Thread Status:
Not open for further replies.

Share This Page