Solved Need help with fall damage

Discussion in 'Plugin Development' started by aaron1998ish, Jan 11, 2016.

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

    aaron1998ish

    Hi,
    Im still learning java, and trying to mess around in my free time with Bukkit plugins

    Ive got a side project im working on and want to cancel FallDamage only when the player right clicks my "High jump" button..

    Ive tried adding "falldamage.fd" (my fall damage cancel class) (Was also an experiment, to see if i was able to make code a little less messy), but it gets caught up in the loop lol, and i end up getting shot into the air like a rocket (Should have known)

    Im not really expecting to be spoon fed, but rather pointed in the right direction :p

    I know how to cancel the Fall damage, but im trying to not disrupt normal Survival gameplay with this gadget...
    Ive got the highjump code running inside a "Bukkit Runnable" if thats a bad idea let me know..

    Would you think a fall damage timer would work? for example The jump may last 3 seconds 1.5 up then 1.5 down, if i had a runnable timer cancel fall damage for that player for 4 seconds when they click on the special jump block, after that the timer would cancel and the player can still experience fall damage, if he/she decides to take a normal jump off a cliff lol..

    Thx, sorry if this thread is messy, im in a rush to go out today lol

    --

    Okay, i think ive sorted the mess out, but still wondering if this is the best way to go about it..

    Ive added players who have permission to right click my jump key to an arraylist, and made an event that will only cancel fall damage if a certain player is inside that array list, and it works like a charm..
    couldnt believe i didnt think of this before xD, i feel like the runnable timer would have been a waste of resources and time lol


    (Merged by Myrathi)
     
    Last edited by a moderator: Jan 11, 2016
  2. Offline

    Irantwomiles

    usually what I have trouble with. This isn't a forums for teaching java...
     
  3. Offline

    aaron1998ish

    I know that, I'm not a "starter" I've been studying for a bit, I was kinda just looking for or validating if my ideas worked, java docs helped a lot
     
  4. Offline

    ProSl3nderMan

    High jump button? You assigned a key from the keyboard?
     
  5. Offline

    aaron1998ish

    No, it's an item that's given to a player when he activates the GUI, if he clicks on it he gets either fly if he right clicks and high jump if he left clicks
     
  6. Offline

    Areoace

    My suggestion:

    Activate high jump: Put them in an ArrayList/HashMap

    FallEvent: Remove them from it.

    @aaron1998ish
     
  7. Offline

    aaron1998ish

    Thx man, already did that.. The mod removed my reply because it was technically a "quick" bump... -.- got an infraction from it too lol.

    On the side note if quick bumping a an issue.. They should have a bump button lol, I've seen may other forums do it.
     
  8. Offline

    87pen

    Removed, I'm an idiot who can't read. If your problem is solved mark it as such.
     
  9. Offline

    aaron1998ish

    Sorry, I've marked it as solved lol... Thx for the help (edited now) p.s I'm not impatient and personally hate impatient "bumpers" just made an honest mistake with replies :p

    Cheers
     
  10. Offline

    87pen

    @aaron1998ish Ah I get impatient if you read my post before I edited it out sorry I forgot how to read.
     
Thread Status:
Not open for further replies.

Share This Page