aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/events/EntityInteractionEvent.kt
blob: 123ea393d80df3825112f8cad10e4d77a67dd1bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package moe.nea.firmament.events

import net.minecraft.entity.Entity
import net.minecraft.util.Hand

data class EntityInteractionEvent(
    val kind: InteractionKind,
    val entity: Entity,
    val hand: Hand,
) : FirmamentEvent() {
    companion object : FirmamentEventBus<EntityInteractionEvent>()
    enum class InteractionKind {
        /**
         * Is sent when left-clicking an entity
         */
        ATTACK,

        /**
         * Is a fallback when [INTERACT_AT_LOCATION] fails
         */
        INTERACT,

        /**
         * Is tried first on right click
         */
        INTERACT_AT_LOCATION,
    }
}