set block to player head with custom NBT "some nbt here"

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

OctoHash25

New Member
Aug 9, 2021
6
0
1
23
Hello! I'm trying to make a skript that sets blocks in a chunk when the chunk generates. I want the block to be a player head with NBT.

CODE:

set block above {_block} to player head with nbt "{SkullOwner:{Id:""68bb46f2-ad7c-4ad7-969b-098b0c72de47"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjgzMjM2NjM5NjA3MDM2YzFiYTM5MWMyYjQ2YTljN2IwZWZkNzYwYzhiZmEyOTk2YTYwNTU1ODJiNGRhNSJ9fX0=""}]}}}"

ERROR:

a block can't be set to 'player head with nbt "{SkullOwner:{Id:""68bb46f2-ad7c-4ad7-969b-098b0c72de47"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjgzMjM2NjM5NjA3MDM2YzFiYTM5MWMyYjQ2YTljN2IwZWZkNzYwYzhiZmEyOTk2YTYwNTU1ODJiNGRhNSJ9fX0=""}]}}}"' because the latter is neither an item type nor a block data (treasuregems.sk, line 171: set block above {_block} to player head with nbt "{SkullOwner:{Id:""68bb46f2-ad7c-4ad7-969b-098b0c72de47"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjgzMjM2NjM5NjA3MDM2YzFiYTM5MWMyYjQ2YTljN2IwZWZkNzYwYzhiZmEyOTk2YTYwNTU1ODJiNGRhNSJ9fX0=""}]}}}"')

My addons:
Skellett
SK-NBeeT
skRayFall
skUtilities
TuSKe
Ersatz
Skent
SkQuery
Skript-Mirror
Skript-Placeholders
Skript-yaml
SkStuff
jNBT

Please help me. I've been trying to solve this for 3 days.
 
Not sure but try
Code:
set {_block} to player head
add nbt "{SkullOwner:{Id:""68bb46f2-ad7c-4ad7-969b-098b0c72de47"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjgzMjM2NjM5NjA3MDM2YzFiYTM5MWMyYjQ2YTljN2IwZWZkNzYwYzhiZmEyOTk2YTYwNTU1ODJiNGRhNSJ9fX0=""}]}}}" to {_block}
set block above player to {_block}

Never really used NBT, there is a high chance that my syntax doesn't even exist
 
Not sure but try
Code:
set {_block} to player head
add nbt "{SkullOwner:{Id:""68bb46f2-ad7c-4ad7-969b-098b0c72de47"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjgzMjM2NjM5NjA3MDM2YzFiYTM5MWMyYjQ2YTljN2IwZWZkNzYwYzhiZmEyOTk2YTYwNTU1ODJiNGRhNSJ9fX0=""}]}}}" to {_block}
set block above player to {_block}

Never really used NBT, there is a high chance that my syntax doesn't even exist


I tried using this, but it doesn't work! Thanks for trying, thought!
 
You can't "Add NBT" per say, but you can achieve the same effect by using:
Code:
set {_block} to player head
execute player command "setblock ~ ~3 ~ %{_Block}%{SkullOwner:{Id:""68bb46f2-ad7c-4ad7-969b-098b0c72de47"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjgzMjM2NjM5NjA3MDM2YzFiYTM5MWMyYjQ2YTljN2IwZWZkNzYwYzhiZmEyOTk2YTYwNTU1ODJiNGRhNSJ9fX0=""}]}}}" as op
which will make the player run the command /setblock as an operator (Doesn't make them an actual operator it just executes the command as the player to get the location)
 
You can't "Add NBT" per say, but you can achieve the same effect by using:
Code:
set {_block} to player head
execute player command "setblock ~ ~3 ~ %{_Block}%{SkullOwner:{Id:""68bb46f2-ad7c-4ad7-969b-098b0c72de47"",Properties:{textures:[{Value:""eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjgzMjM2NjM5NjA3MDM2YzFiYTM5MWMyYjQ2YTljN2IwZWZkNzYwYzhiZmEyOTk2YTYwNTU1ODJiNGRhNSJ9fX0=""}]}}}" as op
which will make the player run the command /setblock as an operator (Doesn't make them an actual operator it just executes the command as the player to get the location)

I know about this. I tried doing this but it said something like "chunk is not loaded ... bla bla bla"

Thanks for trying to help, though!
 
How could the chunk not be loaded it's setting the block above the player's head?
 
How could the chunk not be loaded it's setting the block above the player's head?

I don't need it to be above head:
the code is sth like this:

on chunk generate:
sets a random block in that chunk with a player head with custom nbt
 
Ok, well your issue is that the player loads specific chunks around him / her, but that means it could still be unloaded.
[doublepost=1631043965,1631043911][/doublepost]because the player isn't in the middle of the chunk meaning it's high probability for the block to spawn outside of the chunk the player is in
 
Status
Not open for further replies.