Problem with launching player

Discussion in 'Spigot Plugin Development' started by HAMMERxPL, Oct 12, 2019.

  1. Hello, I have problems with cool effect of launching player. I found cool effect on Hypixel and I'm trying to create something similar. Here's video: https://cl.ly/2c6700c28b60
    I tried spawning entities and setting player to a passenger of it, but it didn't work that well. I also see that on this video it ejects player couple blocks above the ground. How to create this whole effect? Thanks for help!
     
  2. To start off with:
    You make the player a passenger of some other object. You set a velocity. You check if there's a solid block (i.e) 3 blocks under the launched player every few ticks. If there is, eject.
    When you find issues, adapt.

    PS.
    Don't expect someone else to write the code for you.
     
    • Agree Agree x 1
  3. @drives_a_ford you didn't say anything new but I will try to make it perfect today. Thanks for your help. ;)
     
  4. What do you mean he didn't say anything new? He told you how to do it, when you provided 0 code of what you've done so far.
    https://i.gyazo.com/8f1abd220854d37b7f6e9388e300fff3.mp4 - Copied step by step what he said and got my replica
    Code (Java):
     @EventHandler
        public void onTick(TickEvent e) {
            e.stream().forEach(a -> {
                Block under = getFeetBlock(a, 0.3D);
                if(under.getType() == Material.GRASS_BLOCK) {
                    a.remove();
                }
            });
        }