Solved Will this work smoothly or not?

Discussion in 'Plugin Development' started by iSexyChocobo, Dec 21, 2014.

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

    iSexyChocobo

    Heyo,

    I'm working on a plugin that reduces damage when you're wearing a certain kind of armor - and I want the protection to increase when wearing a full set of armor, obviously.

    So I was wondering, if this was in the same code,

    if(example = true){
    e.setDamage(e.getDamage + 5) }

    if(example2 = true{
    e.setDamage(e.getDamage + 10) }

    Would it stack? I.e would the damage now be 15, or would the second code override the first and make the damage 10?

    Thanks
     
  2. Offline

    Rocoty

    @iSexyChocobo I have a great idea that may help you find out. I don't know if you've ever tried it, but it will certainly come in handy in the future, and doesn't take you long. Basically...



    Test it!
     
  3. Offline

    iSexyChocobo

    @Rocoty
    The link didn't work ;)

    (on a more serious note, I don't have access to a Minecraft-capable computer at the moment, and thus I'm stuck having to guess, and I don't want to waste time writing something that won't work. :p good one though.. I'll make sure to try it out sometime)
     
  4. Offline

    Rocoty

    iSexyChocobo likes this.
Thread Status:
Not open for further replies.

Share This Page