How to break blocks in adventure gamemode with empty hand (video of what I want is attached)

Discussion in 'Plugin Development' started by Darkmun, Oct 9, 2022.

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

    Darkmun

    Hello. I want to understand how this works:



    I just hold down the left mouse button and the grass breaks (in middle of the video I clicks lmb few times instead of hold).

    I was trying to do something like sending blockchange packets in PlayerInteractEvent, but in adventure gamemode this event is not called. I thought maybe it's implements with PlayerAnimationEvent and Player#getTargetBlock(), but in adventure gamemode this event is called only one time - when I click a lmb (on the video i hold lmb).

    I hope someone can help with how to implement this.

    Minecraft version: 1.12.2
     
    Last edited: Oct 9, 2022
  2. Offline

    Kars

  3. Offline

    Darkmun

    @Kars "I was trying to do something like sending blockchange packets in PlayerInteractEvent, but in adventure gamemode this event is not called" - I write this in first post
     
  4. Offline

    Kars

    So have players in survival mode and cancel every other interaction.
     
  5. Offline

    Darkmun

    But on the server in attached video all players in adventure gamemode. So I need to know exactly how to do this in adventure mode.
     
  6. Offline

    Kars

    How do you know they're in adventure mode?
    Either way, to do this you somehow need to capture left clicks and without the event that might not be possible. I could be wrong.
     
  7. Offline

    Darkmun

    Just because I know)
    Hm... Okay. Then I will try to ask the developer of this feature about the implementation when he joins to the server

    UPD: Well, I asked the developer of this feature, and he said that he did it using packets, but also said that you can't do this without your own client (yeah, the server from the video has its own client).
     
    Last edited: Oct 11, 2022
  8. Offline

    Kars

    So i was right.
    You can still achieve this feature my mimicing adventure mode in survival mode simply by cancelling every interaction.
     
  9. Offline

    Darkmun

    Yes, but you can still touch blocks and even break (but it breaks for a moment and then recovers (as if I canceled BreakBlockEvent)) so it doesn't look very nice:)
     
  10. Offline

    Kars

    @Darkmun it's that or a client modification.
     
    bennie3211 likes this.
Thread Status:
Not open for further replies.

Share This Page