Creative - Middle Click Event

Discussion in 'Spigot Plugin Development' started by B1acksheep, Feb 1, 2016.

  1. Hey,
    I try to prevent the "middle-click & get Block" function for some Block Types.
    I have tried it already with the PlayerInteractEvent. But the contained Action has only Left_Click_Block, Left_Click_Air, Right_Click_Air, Right_Click_Block. No option for Middle click.

    Does anyone know a solution?

    I saw this thread here, but unfortunately, the discussion goes in another direction.
     
  2. No packet is sent when the player picks up an item from the creative inventory. this packet, however, does get sent, only it happens when the player puts that item in their actual inventory. I believe the InventoryCreativeEvent event is called when this packet is sent.
     
  3. Beware when developing with middle click, I received update requests because Mac users were unable to use it.

    Edit: Ignore me, I didn't fully read the request. :p
     
  4. Use the ClickType enum to do ClickType#MIDDLE
     
  5. middle click gets the block on a minecraft level. if you have special stuff attached to a block it won't get copied so i don't see why you need it. However if you really want to do this
    Edit: @GamerzKing has a better method then what i had suggested. much better so just use his.
     
    • Friendly Friendly x 1