blockdisplay.sk

Created by GTR

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

#arg-1 is for what block you want the display block to be.
#If you want to delete a block, use "delete" or "remove" in arg-1.
#The entity's hitbox DOES NOT extend with the scaling! You must be right next to the hitbox to delete the entity. Using f3+b is very helpful in finding it.

#arg-2 is just an extension of the functions of arg-1, with exception to scaling.
#By default the entity is aligned to the xyz axis. Use "-axis" in arg-2 to ignore this.
#If you want to delete ALL block display entities, use "all" in arg-2 following "delete/remove" in arg-1.

#To use scaling, just use "scale" in arg-2, followed with a number in arg-3.
#Scaling also snaps to the axis by default. Use "-axis" in arg-4 to disable this

#Setting the sendCommandFeedback gamerule to false cleans up the chat a bit.
#Requires mc version 1.19.4+
#Made by GalaThundR



command /bd <string> [<string>] [<number>] [<string>]:
	description: Create block display entities.
	aliases: blockdisplay
	usage: &c/bd [block] scale [number] (-axis)
	permission: op
	trigger:
		if arg-1 is "delete" or "remove":
			if arg-2 is "all":
				make player execute command "/minecraft:kill @e[type=minecraft:block_display]"
				send "&6Removed &call &6Block Display entities" to player
				stop
			if arg-2 is not set:
				make player execute command "/minecraft:kill @e[type=minecraft:block_display,limit=1,distance=..1.5]"
				send "&6Removed Block Display entity" to player
				stop
		set {_block} to arg-1 parsed as blockdata
		set {_blocktype::*} to "%{_block}%" split at "["
		if {_block} is a blockdata:
			if arg-2 is not set:
				make player execute command "/execute align xyz run summon block_display ~ ~ ~ {block_state:{Name:""%{_blocktype::1}%""}}"
			else if arg-2 is "-axis":
				make player execute command "/summon block_display ~ ~0.5 ~ {block_state:{Name:""%{_blocktype::1}%""},transformation:{translation:[-0.5f,-0.5f,-0.5f],left_rotation:[0f,0f,0f,1f],scale:[1f,1f,1f],right_rotation:[0f,0f,0f,1f]}}"
			else if arg-2 is "scale":
				if arg-3 is set:
					set {_scale} to arg-3
					set {_center} to arg-3 / 2
					if arg-4 is "-axis":
						make player execute command "/summon block_display ~ ~%{_center}% ~ {block_state:{Name:""%{_blocktype::1}%""},transformation:{translation:[-%{_center}%f,-%{_center}%f,-%{_center}%f],left_rotation:[0f,0f,0f,1f],scale:[%{_scale}%f,%{_scale}%f,%{_scale}%f],right_rotation:[0f,0f,0f,1f]}}"
					else:
						make player execute command "/execute align xyz run summon block_display ~ ~%{_center}% ~ {block_state:{Name:""%{_blocktype::1}%""},transformation:{translation:[-%{_center}%f,-%{_center}%f,-%{_center}%f],left_rotation:[0f,0f,0f,1f],scale:[%{_scale}%f,%{_scale}%f,%{_scale}%f],right_rotation:[0f,0f,0f,1f]}}"
					send "&aSummoned new Block Display entity with data &6%{_blocktype::1}% &ascaled to &6%{_scale}%." to player
					stop
			else:
				send "&cCorrect usage: /db [block] scale [num]"
				stop
			send "&aSummoned new Block Display entity with data &6%{_blocktype::1}%." to player
		else:
			send "&cInvalid block type" to player