aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/moe/nea/firmament/events/EntityInteractionEvent.kt
blob: fe168682dd3416745243440b917f5739bba27302 (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
30
31
32
33
34
/*
 * SPDX-FileCopyrightText: 2024 Linnea Gräf <nea@nea.moe>
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

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,
    }
}