Invisible Armour.

Discussion in 'Plugin Development' started by MinezBombz, Sep 26, 2014.

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

    MinezBombz

    So I'm making a plugin, and for this plugin I require that the Players armour is to become invisible for a period of time, and when that period of time is up, the armour re-appears. Could anyone suggest a way that I can use to achieve this?

    -Thank you
     
  2. Offline

    Monkey_Swag

    Not very sure if this is possible, but you could hide the player. That's what I do when I hide players' armor
     
  3. Offline

    CraftCreeper6

  4. Offline

    97WaterPolo

    MinezBombz
    You could get the armor points and calculate the damage yourself for EntityDamageByEntityEvent.

    When its activated create a hash map with the players name and. get inventory().getArmorContents(). Then remove their armor, and create a scheduler to add the armor back after a period of time.
     
  5. Offline

    MinezBombz

    97WaterPolo The plugin is for pvp though, so removing the armour would be a problem, but thank you.
     
  6. Offline

    CraftCreeper6

  7. maybe remove the armour for the period time. and when the player gets damaged withing the time where he has no armour, give him the armour for a few ticks and then remove it again. when the time is up put the armour again on
     
  8. Offline

    97WaterPolo

    MinezBombz
    Sorry, I mid said that, you get rid of the armor, but calculate the given damage as if they were wearing it on EntityDamageByEntityEvent.

    Add the player and their armor to a hashmap and then remove their armor.
    If the player is damaged and on the list cancel the damage event, then manually set their health to what it would be if they had that armor on.
     
  9. Offline

    fireblast709

    97WaterPolo Mind you that damage calculations involve randoms. There is no way you can predict the actual damage dealt
     
  10. Offline

    97WaterPolo

    fireblast709
    True, but you can get within half a heart to a heart, only issue would be critical but you can get the location of the target and check to see if their y is above you.

    This is how I would do it, I never really researched into packets and armor, I do believe protocol lib can do it, but if you don't want to use protocol lib I think this is your only alternative.
     
  11. Offline

    fireblast709

    97WaterPolo Half a heart can be a huge difference in PvP :p. ProtocolLib all the way.
     
  12. Offline

    97WaterPolo

  13. Offline

    MinezBombz

    Okay, ProtocolLib it is. Thank you all!
     
Thread Status:
Not open for further replies.

Share This Page