*REAL* Feather Falling

Discussion in 'Archived: Plugin Requests' started by nick131, Oct 30, 2012.

  1. Offline

    nick131

    I'm wondering if it's possible to make a mod where feather falling is actually, feather falling. In other words, I want the players to fall down at a speed of two blocks or so per second, but land and still take the damage they normally would in vanilla minecraft with feather falling. For example, if I had feather falling four and I jumped off a 100 block drop, I would want to fall down at a relatively slow pace (so I can navigate better and more accurately), but still take the damage I normally would, which in this case, would be about 9 hearts. Is it possible? If so, can someone try to make it? :3
     
  2. Offline

    piano9uber

    I don't know if this is possible to do. Ask someone else thats more experienced :p
     
  3. Offline

    cman1885

    This is very interesting and I want to do it. However, I have no power because of a hurricane and probably won't for a few more days, so I can't start. If nobody else takes this up, I'll definitely do it.
     
  4. Offline

    piano9uber

    Hurricane Sandy? I was affected by it, my internet finally came back on about 10 minutes ago -_-
     
    chasechocolate and TacoMuffinCow like this.
  5. Offline

    cman1885

    That's the one. About 8 trees fell on my street and PSE&G said it won't even enter my town for like 4 days, so..
     
  6. Sounds interesting, I might give it a shot.
     
  7. Offline

    nick131

    Hurricane sandy hit us too, we're lucky to have power. Only street in town baby! Also, thanks ;3
     
  8. Offline

    RingOfStorms

    The falling can be done just fine, it's getting the damage that is pretty much impossible after making a player fall slower.
     
    TacoMuffinCow likes this.
  9. Just a thought, but maybe as soon as the featherfalling effect starts, it could check how much blocks it dropped, and converts it to normal feather falling damage..
     
  10. Offline

    PogoStick29

    Simple. Make a PlayerMoveEvent and if they are falling (do some checking) set their y velocity to less than what it was.
    Here's a random code I wrote. I know it won't work, but it gives you an idea on how to do it.
    Code:
    @EventHandler
    public void onPlayerMove (PlayerMoveEvent e) {
      if (e.getPlayer().isFalling()) { // I know that's not real
        e.getPlayer().setYVelocity(e.getPlayer().getYVelocity()-1); // Something like that
      }
    }
     
  11. Offline

    Woobie

    No such thing as isFalling, but you could check
    Code:
    Block block = player.getLocation().getBlock().getRelative(BlockFace.DOWN);
        if (block.isEmpty() {
    //stuff
     
  12. Offline

    PogoStick29

    if (e.getPlayer().isFalling()) { // I know that's not real
     
  13. Offline

    cman1885

    Ok, I'm doing this. Anyone else who is doing it also feel free, but I want to do it aswell.

    How do you want this to handle landing in water?
     
  14. Offline

    nick131

    I think water should negate fall damage as normal.
     
  15. Offline

    cman1885

    The tough thing is that minecraft doesn't have a uniform way of handling fall damage into water, or so it seems. In places where you land in 3 deep water you can die, but if you jump before going down you can live in 1 deep water.. It's complicated. If you want I can make my own, fair, way?
     
  16. Offline

    nick131

    sure!
     
  17. Offline

    Deathmarine

    SUDO CODE:
    Lies (open)

    Code:java
    1. public class Somename extends JavaPlugin implements Listener{
    2. public void onEnable(){
    3. this.getServer().getPluginManager().registerEvents(this, this);
    4. }
    5. @EventHandler
    6. public void onMove(PlayerMoveEvent event){
    7. if(!event.getPlayer().getInventory().getBoots().containsEnchantment(Enchantment.PROTECTION_FALL)
    8. &&event.getFrom().getY()>event.getTo().getY()
    9. &&!((CraftPlayer) event.getPlayer()).getHandle().onGround){
    10. Vector v1 = event.getPlayer().getLocation().getDirection();
    11. v1.setY(-2);
    12. event.getPlayer().setVelocity(v1.multiply(0.03));
    13. event.getPlayer().setFallDistance(0);
    14. }
    15. }
    16. }
     
    PDKnight likes this.

Share This Page