Custom Enchant Plugin Help

Discussion in 'Plugin Development' started by Basketkings22, Jul 23, 2015.

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

    Basketkings22

    So ive been coding a plugin with a whole bunch of custom enchants on it and im adding one Called Thermal and what i want it to do is when an enemy hits you (if you have this enchant on your armor) there is a chance of being lit on fire
    What is the code for doing so?
     
  2. Offline

    Ganga

    one does not simply ask for code.
    First you try it on your own and if you get stuck you can ask for help.

    All I can say to you:
    Code:
    public void onAttack(EntityDamageByEntityEvent event) {
    if(event.getEntity() instanceof Player) {
                defender = (Player)event.getEntity();
    //here you instert your code to check if player has enchantment        }
    }
     
  3. Offline

    mine-care

    @Basketkings22 That strongly depends on the way you have implemented those "fake" enchantments. Please have an attempt on this yourself and then if you need our asistance at any part just ask.

    In these forums we (most of us) keep spoonfeeding to minimum.
     
Thread Status:
Not open for further replies.

Share This Page