Is there an MLG type of Java class?

Discussion in 'Plugin Development' started by ssnipxr, Jul 16, 2021.

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

    ssnipxr

    Basically I'm trying to make a plugin that revolves around 'Manhunt, But Clutching Gives OP Items' but I want to know if theres a simpler way to identify if a player clutches or not. I'm not exactly sure how to do it since I'm trying to learn how to code without tutorials. I have the OP item algorithm already but I still need for there to be an event to activate it.
     
  2. Offline

    c7dev

    What do you mean by clutching? Like, if the player wins the game? If that's the case it depends entirely on what plugins or code run the game. If you mean sneaking (where a player presses Shift), it's PlayerToggleSneakEvent.
    Also, nothing wrong with learning to code from tutorials, that's why they're there :)
     
    Last edited: Jul 16, 2021
  3. Offline

    Shqep

    @c7dev
    Pretty sure by clutching they meant like MLG water buckets, boat clutches like the ones big green boi does. If so, that's not very straightforward to implement.
     
  4. Offline

    c7dev

    Yes, definitely not something that's easily built into bukkit. However, it's still possible to do it, if you use PlayerInteractEvent with a lot of conditions.
    Since @ssnipxr you said you don't want tutorials, I'll just describe what can be coded: If the event is called, the action is RIGHT_CLICK_BLOCK, the player's item in hand is a water bucket, the player's Y velocity is < -0.5, and the clicked block's Y value is <= the player's location Y value, those are the conditions that could trigger your code for a clutch.
    If you need the actual code I can provide that too.
    Note that normally you would use BlockPlaceEvent, although that doesn't work with liquids such as water. This would only cover water bucket clutches, other types would have to be coded similar to this.
     
Thread Status:
Not open for further replies.

Share This Page