1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Splash Potions

Discussion in 'Development' started by xjohannaxx, Oct 26, 2018.

  1. xjohannaxx

    xjohannaxx Silverfish

    Messages:
    16
    How could I make it so splash potions are don't go so far
     
  2. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    Don’t throw it far lmao
     
  3. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Cancel the interact event and make them give you effects instantly. As I can see from a small research, the only code that exists for the splash potions' shooting in PocketMine is the splash particle and the sound for when the potion hits the ground. This means that you cannot change that because it is not handled by PocketMine, it is handled by the client. You can test that by getting some splash potions, running a command that will sleep(10); (stop any server tasks for 10 seconds) and throw the potions till it "unlag". This would actually prove that the splash entity appears without any server-related actions, but the particle effect and the sound appear when the server "unlags" which means the server handles that. What you may be able to do is to edit the PocketMine's code (not recommended) and edit the position of the place the particle will show.
    Here is what I found:
    https://github.com/pmmp/PocketMine-...ne/entity/projectile/SplashPotion.php#L82-L83
     
    jasonwynn10 likes this.
  4. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    It deosn't just stop the server tasks. It completely kills the server for those 10 seconds. Be careful you don't really break something with that (like world corruption)
     
    EdwardHamHam likes this.
  5. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Yes, that thing.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.