Help with plugin

Discussion in 'Plugin Development' started by Eboss34, Feb 20, 2016.

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

    Eboss34

    So I need a way to make it so that when someone gets below 3 hearts, they will get launched into the air and when they come back down they wont take any fall damage. I have gotten the health check thing but the launching into air and no fall damage thing I haven't gotten that down. Also with the no falldamage, after they hit the ground they need to be able to take fall damage again, so no fall damage just for when they get launched into the air. Please Help. If you need more explanation then I will try.
     
  2. Offline

    Tails_Prower_24

    What plugin are you using?
     
  3. Offline

    ACA30

    I believe that what he means is that he is trying to code his own plugin.

    @Eboss34 : I'm not really a developer, so I wouldn't know. (Lol try looking it up on YouTube or Google...)
     
  4. Offline

    Eboss34

    Yeah, I'm trying to code my own plugin. I just need the launch and to negate the fall damage.

    So to give a little bit more information, this is for a custom enchantment plugin and the enchantment makes it so when you get low on hearts you will have a chance to escape. I have everything completely done except for the launching part and negating fall damage part.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 20, 2016
  5. Offline

    Rexcantor64

    Two things:

    You should ask it on plugin development forum, but the good new: I'm a developed too.

    Now about your plugin: I think there is a method (Don't know if it's on player or world) that you can knockback the player. To make no fall damage, just add a player to an arraylist when you knockback it and when it falls(PlayerDamageEvent) cancel the event IF the player is on the arraylist AND if the e.getDamageCause() is DamageCause.FALL. (Don't forget to remove the player from the arraylist)
     
    oceantheskatr likes this.
  6. Offline

    Eboss34

    ok thanks i will try that and tell you if it works.
     
  7. Offline

    Eboss34

  8. Offline

    teej107

  9. Offline

    Eboss34

    I can't get it to work.

    Yeah so this won't work and I have also tried a bunch of different player.setVelocity stuff. It just won't work. When I use the player.setVelocity thing it doesn't work but it doesn't create a problem with the plugin and nothing shows up in the console either. I have heard that there is a problem with bukkit and the set velocity thing.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Feb 24, 2016
  10. Offline

    teej107

    @Eboss34 No there is not a problem with setting the velocity. It's most likely your code. You actually don't need to mess with velocities. Show us what you have so we can work from there.
     
    Eboss34 likes this.
  11. Offline

    Eboss34

    Last edited: Feb 24, 2016
  12. Offline

    teej107

    @Eboss34 Launching into the air does require setting velocity but cancelling fall damage doesn't.
    1. When a player gets below 3 hearts and is launched into the air, add them to a Collection. Preferably a Set.
    2. When a player takes fall damage and they are in the Set, cancel the damage and remove them from the Collection. Depending on how your map is, you may need to check if they are on the ground in order to remove them from the Set because they may "fly" up onto higher ground and not take fall damage anyway.
     
  13. Offline

    Eboss34

    @teej107 I don't exactly know how to set up the whole set or collection thing so could you help or tell me where I can find a tutorial?
     
  14. Offline

    teej107

  15. Offline

    Eboss34

    so will that be really complicated to make? And do you have an example or video I can watch because all the link does is tell me what the different collections are and don't really tell me how to use them or set them up.

    Sorry if this should be really easy. I know how to do some stuff but not really that much coding with this so it is still new to me.
     
  16. Offline

    Zombie_Striker

    @Eboss34
    If you're only looking for things you can copy and paste, you're going to have a hard time being a programmer.

    The link explains what collections are and how to use them. @teej107 explained everything you need to do. That should be all you need to fix your problem.
     
  17. Offline

    Eboss34

    Yeah, ok. I should be putting more effort into it to get it done. Thanks.
     
  18. Offline

    brandawg451

    I have played on a sever called Cosmicpvp and its called Rocket Escape is the plugin will enchant like that
     
  19. Offline

    Eboss34

    @teej107 Call me stupid but I still don't understand how to make a collection. I went to the link and when I click on the "Set" link it doesn't make any sense at all. I don't know how to do it so don't, like a few posts ago said, give me something to copy and paste, just give me some directions on what I need to look at to form the collections on your link.

    I'm sorry I cant understand because you have been a huge help in all this.

    @brandawg451 Yes but I am changing name so no copyright things will happen.

    - Eboss34
     
  20. Offline

    teej107

    @Eboss34 A Collection used as an Object. Use it like any other Object or Collection. I feel like I said something like this in that link :p
     
  21. Offline

    Eboss34

    @teej107 Oh. Ok. I guess I didn't catch that part. ThankYou

    -Eboss34
     
Thread Status:
Not open for further replies.

Share This Page