Questions About Splash Potions...

Discussion in 'Plugin Development' started by spiroulis, Mar 5, 2014.

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


    Hey so i was wondering how can you get if the player holds a specific type of splash potion? And how can i make it infinite? Thats all thanks :)
  2. Offline


    you can get the players item in hand by using:

    then you should listen for the interact event, check if it's right click, check if the item was your special potion and
    remove the default potion effect from the player.
    Then add the new effect to the player which has as time something like 1000000
  3. Offline


    Minecrafter_NL xd i already know these things, you probably didnt get what i mean, im not the best explainer... I ment that how can you check if the item in the players hand is a splash potion that damages people for example.
  4. Offline


  5. Offline


    Desle hmmm how can i do that? i tried this but i failed hard
    1. player.getItemInHand().getData()
  6. Offline


  7. Offline


    The different potions are just changed by "durability" in minecraft, you would have to do some tedious checking but what you would do is
    1. if(player.getItemInHand().getDurability().equals((short) 16388)){
    2. //^^If it's a poison potion
    3. player.getItemInHand().setAmount(64)
    4. }
Thread Status:
Not open for further replies.

Share This Page