So just like with items paper plugins are not really supposed to have blocks and items because that's what mods do, but i made blocks anyway... you see back in 1.19.4 (which feels like so long ago now) they added the block display, text display and item display. so you would think that for a custom block i would add a block display... NO i had to use an item display because i was having a hard time getting it to read the model so i just gave up and used the model i already have..
COLLISIONS
so how i did this is making an invisible shulker with no AI, a passenger of the item display. then i had to mess with the translation (movement) because it was misaligned but once it was ready i put the finished command into the plugin..
OH GOD
so this is where it started getting bad... you see in game i could just use "execute align xyz run" to align it to the block grid. but in the plugin it just wouldn't work. so i had to do the snapping on the players current position then slap that into the command.. the code was...
val player = source
.sender as? org.bukkit.entity.Player ?: return
val loc = player.location
val snapX = if (loc.blockX < 0) "${loc.blockX + 1}.5" else "${loc.blockX}.5"
val snapY = "${loc.blockY}"
val snapZ = if (loc.blockZ < 0) "${loc.blockZ + 1}.5" else "${loc.blockZ}.5"
val alignedLocationString = "$snapX $snapY $snapZ"
its an absolute disaster and you know the first 2 lines, originally that wasn't there and the input was just "~ ~ ~".... yeah so it wasn't doing ANY maths on it so i had to get the players location that way.....