Get armour and set effects

Discussion in 'Plugin Development' started by Faith, Mar 3, 2015.

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

    Faith

    How would I add effects to a player when he/she is wearing a full set of armour and have the effects configurable by end user?
     
  2. Offline

    mine-care

    @Faith I think this question is way too general you're essentially asking us how to make a armor effect plugin.
    So a structural explanation looks like this:
    1 have a way to know if user wears the specific armor that is suppose to have the effects,
    2. When he wears the armor, give the effects.
    If he removes the armor, remove the effects.
     
  3. Offline

    nj2miami

    You are asking pretty open ended question in a development forum with no code example to assist you with.

    Your solution would range from simple (checking what armor is being worn) to moderately complex (reading effects from a config file).

    The simplest solution is to simply check what armor is worn during a InventoryCloseEvent as this captures *most* of the circumstances which you could need, although there are quite a few ways a player can ultimately "equip" an item. Do some checking and apply some effects. Easy.

    Moving on though, you want to add configurable effects, which requires you to do some YAML and config stuff. This is beyond the scope of my response, so I'll leave you with if you are not familiar with how to read from a config at a minimum, move this to your "to do" list until you learn about it.

    Start with the basics...InventoryCloseEvent , check armor worn = the armor set you decided, apply effects. Then move to more challenging aspects, like capturing the other events which could cause a player to equip armor and config manipulation.
     
Thread Status:
Not open for further replies.

Share This Page