Skip to content

Instantly share code, notes, and snippets.

@ShiftSad
ShiftSad / NPC.kt
Created June 27, 2024 03:01
Here yah go
package codes.shiftmc.minigame.npc
import net.minestom.server.coordinate.Pos
import net.minestom.server.entity.*
import net.minestom.server.entity.Player.Hand
import net.minestom.server.entity.ai.target.ClosestEntityTarget
import net.minestom.server.entity.metadata.PlayerMeta
import net.minestom.server.event.entity.EntityAttackEvent
import net.minestom.server.event.player.PlayerEntityInteractEvent
import net.minestom.server.instance.Instance
@ShiftSad
ShiftSad / EventBuilder.kt
Last active May 2, 2024 13:08
Spigot event api abstraction based on Kotlin's DSL and shynixn's mccoroutine
import com.github.shynixn.mccoroutine.bukkit.launch
import com.github.shynixn.mccoroutine.bukkit.minecraftDispatcher
import org.bukkit.event.Event
import org.bukkit.event.EventPriority
import org.bukkit.event.Listener
import org.bukkit.event.player.PlayerEvent
import org.bukkit.plugin.java.JavaPlugin
import kotlin.coroutines.CoroutineContext
/**
@ShiftSad
ShiftSad / DisplayEntityBuilder.kt
Created September 30, 2023 01:11
Utility based on NBTApi, for building DisplayEntity using Kotlin's DSL
@file:Suppress("unused")
package tech.shiftmc.townywars.api
import de.tr7zw.nbtapi.NBT
import net.kyori.adventure.text.Component
import org.bukkit.Location
import org.bukkit.Material
import org.bukkit.entity.Entity
import org.bukkit.entity.EntityType
@ShiftSad
ShiftSad / Cuboid.kt
Created September 30, 2023 00:21
Min3CraftDud3's Cuboid implementation in Kotlin.
@file:Suppress("unused")
package tech.shiftmc.townywars.api
import org.bukkit.Bukkit
import org.bukkit.Location
import org.bukkit.block.Block
import kotlin.math.min
data class Cuboid(