Questions About Splash Potions...

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

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

    spiroulis

    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

    Minecrafter_NL

    you can get the players item in hand by using:
    yourplayer.getItemInHand()

    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

    spiroulis

    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

    Desle

  5. Offline

    spiroulis

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

    Desle

  7. Offline

    Pimp_like_me

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

Share This Page