Version: https://prnt.sc/tpxc3j
No errors on reload, or in console.
Trying to rotate a player skull, it's placing the skull with correct nbt, broadcasting correct blockface, but isn't setting it. The skull is always facing north.
Spent over an hour trying to figure this out lol
[doublepost=1595951583,1595943567][/doublepost]Got it working! Here's my code if anyone finds this on google:
Code:
import:
org.bukkit.Material
org.bukkit.block.BlockFace
org.bukkit.block.Block
org.bukkit.block.Skull
function setToSkull(owner: string, value: string, loc: location, against: location):
# owner: owner id, value: the texture, loc: location of skull, against: block skull will be placed against
set block at {_loc} to player wall head
set {_block} to {_loc}.getBlock().getState()
set {_face} to {_against}.getBlock().getFace({_loc}.getBlock())
set nbt of block at {_loc} to "{Owner:{Id:""%{_owner}%"",Properties:{textures:[{Value:""%{_value}%""}]},Name:""Notch""},x:%x coord of {_loc}%,y:%y coord of {_loc}%,z:%z coord of {_loc}%,id:""minecraft:skull""}"
broadcast "face: %{_face}%"
{_block}.setRotation({_face})
{_block}.update(true, false)
No errors on reload, or in console.
Trying to rotate a player skull, it's placing the skull with correct nbt, broadcasting correct blockface, but isn't setting it. The skull is always facing north.
Spent over an hour trying to figure this out lol
[doublepost=1595951583,1595943567][/doublepost]Got it working! Here's my code if anyone finds this on google:
Code:
function setToSkull(owner: string, value: string, loc: location, against: location):
# owner: owner id, value: the texture, loc: location of skull, against: block skull will be placed against
set block at {_loc} to player wall head
set nbt of block at {_loc} to "{Owner:{Id:""%{_owner}%"",Properties:{textures:[{Value:""%{_value}%""}]},Name:""Notch""},x:%x coord of {_loc}%,y:%y coord of {_loc}%,z:%z coord of {_loc}%,id:""minecraft:skull""}"
set {_face} to {_against}.getBlock().getFace({_loc}.getBlock())
if "%{_face}%" is "NORTH":
set facing of block at {_loc} to north
if "%{_face}%" is "EAST":
set facing of block at {_loc} to east
if "%{_face}%" is "SOUTH":
set facing of block at {_loc} to south
if "%{_face}%" is "WEST":
set facing of block at {_loc} to west