Skip to content

Instantly share code, notes, and snippets.

@ItsDoot
Last active February 9, 2020 18:42
Show Gist options
  • Select an option

  • Save ItsDoot/a7bbae7419de6096b2506bc5612ae90d to your computer and use it in GitHub Desktop.

Select an option

Save ItsDoot/a7bbae7419de6096b2506bc5612ae90d to your computer and use it in GitHub Desktop.
Sponge InteractEvent Guide

Tested on

  • spongeforge-1.12.2-2838-7.1.7-RC3928
  • spongevanilla-1.12.2-7.1.7-RC297
  • spongeforge-1.12.2-2825-7.1.6
  • spongevanilla-1.12-2-7.1.6

Events are listed in the order that they are fired.

  • left click
    • no held item
      • no target
        • InteractBlockEvent.Primary.MainHand
      • block target
        • InteractBlockEvent.Primary.MainHand
      • entity target
        • InteractItemEvent.Primary.MainHand
        • InteractEntityEvent.Primary.MainHand
    • held item (for tools/items/blocks; tested iron-axe/diamond/poppy/dirt)
      • no target
        • InteractItemEvent.Primary.MainHand
        • InteractBlockEvent.Primary.MainHand
      • block target
        • InteractBlockEvent.Primary.MainHand
      • entity target
        • InteractItemEvent.Primary.MainHand
        • InteractEntityEvent.Primary.MainHand
  • right click
    • no held item
      • no target
        • nothing - no packet is sent
      • block target
        • InteractBlockEvent.Secondary.MainHand
        • InteractBlockEvent.Secondary.OffHand
      • entity target
        • InteractItemEvent.Secondary.MainHand
        • InteractEntityEvent.Secondary.MainHand
        • InteractItemEvent.Secondary.OffHand
        • InteractEntityEvent.Secondary.OffHand
    • held item (for tools/items/blocks; tested iron-axe/diamond/poppy/dirt)
      • no target
        • InteractItemEvent.Secondary.MainHand
      • entity target
        • InteractItemEvent.Secondary.MainHand
        • InteractEntityEvent.Secondary.MainHand
        • InteractItemEvent.Secondary.OffHand
        • InteractEntityEvent.Secondary.OffHand
    • held item (for tools/items; tested iron-axe/diamond)
      • block target
        • InteractBlockEvent.Secondary.MainHand
        • InteractItemEvent.Secondary.MainHand
        • InteractBlockEvent.Secondary.OffHand
    • held item (for blocks; tested poppy; not placed)
      • block target
        • InteractItemEvent.Secondary.MainHand
        • InteractBlockEvent.Secondary.OffHand
    • held item (for blocks; tested poppy & dirt; placed)
      • block target
        • InteractBlockEvent.Secondary.MainHand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment