Double Jump [Should be Easy]

Discussion in 'Archived: Plugin Requests' started by matthayez011, Feb 12, 2012.

  1. Offline

    matthayez011

    Im looking for a plugin where when i player sprints then jumps then jumps agian it will make them jump even higher, sort of like the way Mario does, and even allowing players to triple jump like Mario does
    [but maybe not allowing them to jump that high]
     
  2. Offline

    Roadkill909

    My plugin will do pretty much what you ask, but it may have a lot of stuff attached to it you don't need. It's also in beta though, so you may want to wait until it's out of that stage. All you'd need to do is make a power (which would take 5 minutes through the GUI) and add it to boots or something. Need help, let me know. Link should be in my signature.
     
  3. Offline

    matthayez011

    sweet! thanks dude, but im looking for this a just a simple lightwieght plugin!
     
  4. Not possible without spout + spoutcraft.
     
  5. Offline

    mushroomhostage

    Not exactly what you're looking for, but there are some other plugins out there with similar functionality.

    Godpowers has a /superjump command to "jump to obscene heights". It doesn't let you double-jump, however. Implementing double-jumping is difficult because the movement is controlled by the client - when they press space to jump, they'll be propelled upward if they are on a solid block, otherwise they wouldn't jump since the player is already in the air. Maybe this would be possible to fake by inserting a solid block underneath the player as they jump? That's how some plugins allow "walk on water" or other effects – inserting temporary blocks to alter client-side physics.

    If on the other hand you can settle for jumping using other input besides the jump key, that is much easier (but less usable). All the plugin would have to do is set the player velocity to an upwards vector. In EnchantMore, I just added the Boots + Punch enchantment to do this. By pressing Shift, you can jump, double-jump, triple-jump, or even more, up to a height determined by the enchantment level. It definitely isn't as nice as double-jumping using Spacebar would be, though. Maybe someone can come up with something better.

    (This effect also does not yet take into account forward velocity, and only launches the player upward. But it does work well Boots + Power, which allows you to temporarily fly when you are sprinting. Not quite a jump, but if you sprint then point upwards, you can travel upwards, vaguely similar to what you are asking for.)

    Is true double-jump (even with temporary blocks) really impossible without client mods, or does anyone want to give it a shot?
     
  6. It is impossible, as the jump is client side and you can't jump while you're in the air. Spout + spoutcraft allow to track keys, so you can track pressing the jump key.
     
  7. Offline

    Zarius

    There's an old plugin called "Sprint" (not sure if it works with new builds of CB) which had an unintended side-effect of super-jumping when the user holds shift. Interestingly this was dependant on how long you held the shift key down and the direction you were facing - with a bit of skill (and good latency) you could bounce from ground to tree and treetop to treetop.

    I loved taking down pine trees with a well aimed jump to the top and axing through the centre :) Of course if you missed it hurt :D
     
  8. Offline

    matthayez011

    it would be Sprint -> Jump [Still Sprinting] -> Jump again [But higher] -> Jump again [even higher]
     
  9. Offline

    Waterflames

    It is possible. The double jump itself wouldn't be that hard (edit the velocity vectors), but the double jump detection might be harder...
     
  10. matthayez011 Waterflames It is possible if you jump -> touch ground -> jump again and higher this time.
    But it's not possible to detect pressing the space key while you're not on ground, so a mario like double jump is not possible. Also the first one would be very hard, as you don't want players to jump higher after running upstairs, for example...
     
  11. Offline

    matthayez011

    V10lator the player would definatly touch the ground, and good point but i could like with the stairs issue
     
  12. How can I create a jump in a plugin?

    And I think that that dont would be difficult to create doodlejump without doublejump
    Like that:

    event blablabla if player touches block wool:red (thats only a bad example...)
    then p.jump(20) ; (I dont know how to create a jump to)

    And doublejump could be done too like that:
    If player clicks at the block before him (or at his item in the hand) a glass will be created under him, he
    will jump on it, and it disappears.

    Thats a fast explanation for the idea, if you want I can write it longer...

    MFG
    Black_ixx
     
  13. By setting the players velocity.
     
  14. sorry, but I dont know how to set player coordinates, I have not worked with this anytime..
    Can you tell me please how to set this?
     
  15. Offline

    matthayez011

  16. Offline

    DrBowe

    The only thing that is client side about jumping would be the key itself, it's perfectly possible to recalculate the player's velocity in mid-air and send them up a bit higher.

    As for a 'jump key', that's also simple enough to do. Just use the PlayerToggleSneakEvent to detect whenever the 'Shift' key gets pressed, and use that as your jump key. ;)
     
  17. Offline

    romobomo

    DrBowe
    Beat me to it, was going to suggest that. You could also use a player interact event (eg right click air), or even a double jump "tool"... possibilities are all but endless
     
  18. Offline

    mushroomhostage

    Yup, that's exactly what I do in EnchantMore when you're wearing Boots with the Punch enchantment. Its pretty easy, basically:

    Code:
        @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled=true)
        public void onPlayerToggleSneak(PlayerToggleSneakEvent event) {
            if (!event.isSneaking()) {
                return;
            }
            // pressed shift
            Player player = event.getPlayer();
    
                    player.setVelocity(player.getVelocity().setY(1));
    
    If anyone wants to make a standalone plugin to do just this, shouldn't be that hard. This technique even lets you double-jump by tapping Shift repeatedly. The downside is it makes it more difficult to hold Shift for sneak.. there are ways around this though (different item, right-click, detect double tap, etc.), more complex, but possible.

    About using Space to double-jump: in creative mode, you can use Space to move up even when you are in the air. Hows that work, maybe a plugin could temporarily set creative mode (but only for flying, disabling all other creative mode features) to make double-tapping space to double-jump without client mods?
     

Share This Page