#Convert int array into uuid
24 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Lookup for NbtUtils or putUUID here in the discord
there are some examples I created in the past days
actually I got the UUID from a compound tag
u probably want the NbtUtils solution
let me look for the NbtUtils
if you are in a nbt already there is getUUID() putUUID(uuid)
I tried getUUID("entity") and it didnt work
then it wasn't in uuid format or the key did not exist
Paste version of message.txt from @storm gate
and the code
BlockEvents.rightClicked("kubejs:pedestal", e => {
if (e.hand == "off_hand") return;
/**
* @type {{"item": string, "entity": Internal.UUID}}
*/
let data = e.block.entityData["data"];
let oldItem = data["item"];
data["item"] = e.item.id;
if (data["entity"] != "") getEntityByID(e.block.entityData.getUUID("entity")).kill();
let entity = e.block.createEntity("block_display").mergeNbt({ block_state: { Name: e.item.id } });
e.block.entityData.getCompound("data").putUUID("entity", entity.uuid)
console.log(e.block.entityData)
entity.spawn();
e.player.getHeldItem("main_hand").count -= 1;
e.player.addItem({ count: 1, item: oldItem });
e.cancel();
})