Need Quick Plugin

Discussion in 'Spigot Plugin Development' started by Ovichi, Apr 29, 2017.

  1. I need a very very easy and simple quick plugin

    When you eat a golden apple it doesn't go away.

    Name it InfiniteGapples

    And the name of it tells you everything. This only applies to GOD apples.
     
  2. Never ever goes away? Even after death and after relog?


    Sent from my iPhone using Tapatalk
     
  3. After death the apples will be gone. Don't worry about the relog deal because you have the combattag dealio.
     
  4. Version of minecraft matter?


    Sent from my iPhone using Tapatalk
     
  5. No. At least 1.8+
     
  6. Done, check your PM's
    Source code for anyone that cares.

    Code (Text):

    @EventHandler
        public void onPlayerEat(PlayerItemConsumeEvent e)
        {


         
        if (e.getItem().getType() == Material.GOLDEN_APPLE && e.getItem().getData().getData() == (byte) 1) {
                Player plr = e.getPlayer();

                plr.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 999999, 2));
                plr.addPotionEffect(new PotionEffect(PotionEffectType.ABSORPTION, 999999,4));          
                plr.addPotionEffect(new PotionEffect(PotionEffectType.FIRE_RESISTANCE, 999999, 1));          
                plr.addPotionEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 999999, 1));
     
            }
             
        }
     
    #6 dNiym, Apr 29, 2017
    Last edited: Apr 29, 2017
  7. This would apply to any food item with a data value of 1, such as raw salmon, which is fish with a data value of 1.
     
  8. LOL you are 100% correct sir. will fix
    thats what i get for doing something in a hurry

    https://www.spigotmc.org/resources/infinte-gapples.40162/
     
    #8 dNiym, Apr 29, 2017
    Last edited: Apr 29, 2017
  9. Also, perhaps he meant that the golden apple doesn't disappear, not that the effects are ever lasting. He didn't clarify.


    Sent from my iPhone using Tapatalk
     
  10. Well, he got the latter. That was my interpretation of what he said :D
     
  11. Fair enough


    Sent from my iPhone using Tapatalk