Summoning an entity with nbt

  • 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!

etheboi_

Active Member
Nov 9, 2023
81
1
8
23
I need to summon text above a block and I'm using armor stands with custom names. But it says it doesn't understand the condition make server execute command.

Here's my code:
Code:
on place:
    if event-block is coal ore named "coal-generator":
        set {_coal.gen.loc} to location of event-block
        set {_coal.holo.loc} to {_col.gen.loc}
        add 1 to y-coordinate of {_coal.holo.loc.1}
        set {_coal.holo.loc.2} to {_coal.holo.loc.1}
        subtract 0.5 from y-coordinate of {_coal.holo.loc.2}
        make console execute command "/summon armor_stand %{_coal.holo.loc.1}% {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:'{"text":"Coal Generator","color":"black","bold":"true"}',CustomNameVisible:1b}"
        make console execute command "/summon armor_stand %{_coal.holo.loc.2}% {Invisible:1b,Invulnerable:1b,NoGravity:1b,CustomName:'{"text":"Level 2","color":"aqua","bold":"true"}',CustomNameVisible:1b}"

Any ideas?
 
A few things are going on here.

1.) The location. Skript displays locations different than Minecraft takes them in commands. Skript usually makes locations look like "x: (number), y: (number), z: (number), in world '(world name)'", while Minecraft takes locations in commands as "(number) (number) (number)". To fix this, I'd recommend setting {_coal.holo.loc.1} and {_coal.holo.loc.2} as a text, removing the commas, splitting at every space, then using the second, fourth, and sixth elements in the resulting list (which I believe would be the numbers). It's a bit convoluted, but it gets a bit more intuitive once you get around to making the code for it.

2.) The NBT string. Right now, you're telling Skript to stop the string at ". . . CustomName:'{", because you have a single quote there. Double them when you want a quotation mark character within the string, because Skript will turn that into a single quote once it's parsed. I also *believe* you need quotation marks at every tag ({"Invisible":"1b"})? Take that with a grain of salt though.

Hope this helps.
 
Last edited:
This helps a bit. But how do I fix it? I have SkBee and I need to spawn the stand with NBT data.
 
This helps a bit. But how do I fix it? I have SkBee and I need to spawn the stand with NBT data.

To fix this, I'd recommend setting {_coal.holo.loc.1} and {_coal.holo.loc.2} as a text, removing the commas, splitting at evey space, then using the second, fourth, and sixth elements in the resulting list (which I believe would be the numbers).
and
Right now, you're telling Skript to stop the string at ". . . CustomName:'{", because you have a single quote there. Double them when you want a quotation mark character within the string, because Skript will turn that into a single quote once it's parsed. I also *believe* you need quotation marks at every tag ({"Invisible":"1b"})? Take that with a grain of salt though.

Using SkBee is a bit different, and I'm not sure how to do it in the current version, but I do know there's both the 'spawn entity section' and SkBee's own spawn entity with nbt <nbt compound> effect.
 
I tried using
Code:
spawn armor stand at {_coal.holo.loc.1} with nbt "<nbt>"
but that didn't work
 
I tried using
Code:
spawn armor stand at {_coal.holo.loc.1} with nbt "<nbt>"
but that didn't work
The exact line you used would be nice, as well as skbee version, since they change the syntax.

I mention this because 'with nbt "<nbt>"' has "<nbt>" as a String type, whereas nbt is looking for an nbt compound.

Give my other fixes a try, though.
 
The exact line you used would be nice, as well as skbee version, since they change the syntax.

I mention this because 'with nbt "<nbt>"' has "<nbt>" as a String type, whereas nbt is looking for an nbt compound.

Give my other fixes a try, though.
I don't understand. <nbt> is just a representation of the nbt data i said earlier.
 
In any programming language, there are types. Strings are text, numbers are... numbers, and so on. SkBee expects you to give it an 'nbt compound' type, following the effect "spawn %entity% %location% with nbt ...", but you gave it a string. Whether this is important depends on your SkBee version and how you actually typed it out in the code, hence why I asked for both pieces of information.

None of this would matter if the fixes I proposed work, though, so I recommend giving that a shot first.

Let me know if it works.
 
WhAt FiXeS????
These fixes, which I already requoted for you.
IMG_2859.jpeg


They're quotes from the first comment I made on this thread.
 
so can i try
Code:
spawn 1 armor stand with nbt "Invisible:1b,Invincible:1b,ect"
but how will i add the custom name? and make it visible
 
so can i try
Code:
spawn 1 armor stand with nbt "Invisible:1b,Invincible:1b,ect"
but how will i add the custom name? and make it visible
If you make it invisible ("Invisible:1b"), it won't be visible. To make it visible, don't make it invisible..? Unless you're referring to the custom name, in which case you use CustomNameVisible:1b and rename the last spawned armor stand separately.

While you still haven't told me your SkBee, I can definitely tell you that's not proper syntax in any version. You're lacking curly brackets, and you don't have a location in the spawn effect. How is Skript supposed to know where you want the armor stand?

And if you're not willing to try the fixes I proposed (which most definitely work), why did you ask for help on a forum? It's much easier for both of us if you at least try it at let me know how it goes. If it works, then great, and you can look at one of the many NBT discussions already posted if you have questions about alternate syntax. If it doesn't, then we can problem solve from there, instead of me giving you the same answer to the same question.
 
If you make it invisible ("Invisible:1b"), it won't be visible. To make it visible, don't make it invisible..? Unless you're referring to the custom name, in which case you use CustomNameVisible:1b and rename the last spawned armor stand separately.

While you still haven't told me your SkBee, I can definitely tell you that's not proper syntax in any version. You're lacking curly brackets, and you don't have a location in the spawn effect. How is Skript supposed to know where you want the armor stand?

And if you're not willing to try the fixes I proposed (which most definitely work), why did you ask for help on a forum? It's much easier for both of us if you at least try it at let me know how it goes. If it works, then great, and you can look at one of the many NBT discussions already posted if you have questions about alternate syntax.
no make the custom name visible
 
but how do i make the custom name?
It's. In. The. Same. Exact. Line.
Unless you're referring to the custom name, in which case you use CustomNameVisible:1b and rename the last spawned armor stand separately.
code_language.skript:
set the name of the last spawned armor stand to "<insert name here>"
 
It's. In. The. Same. Exact. Line.

code_language.skript:
set the name of the last spawned armor stand to "<insert name here>"
wait can i do
Code:
spawn 1 armor stand at {<location>} named "<name>" with nbt "<nbt>"
 
wait can i do
Code:
spawn 1 armor stand at {<location>} named "<name>" with nbt "<nbt>"
I'm done replying to this thread.

I've given you fixes. You ignored them. You asked for the fixes. I quoted them for you. You asked for them AGAIN and I even screenshotted and linked them to you so you wouldn't miss it.

You still ignored them.

I asked you before that I can't be specific about syntax when I don't know your SkBee version, and you still -- after me asking twice -- haven't shared it.

Why would you go onto a forum if:
a.) You aren't going to listen to help
b.) You aren't going to give information that's required for the specific type of help you're asking for (which isn't necessary if you did section A).
c.) You're not even going to read my posts half the time.

Good luck. I hope someone else has the mountain of patience required to help you further.

Lord only knows the amount of frustration I've had to vent out from this thread alone.
 
I'm done replying to this thread.

I've given you fixes. You ignored them. You asked for the fixes. I quoted them for you. You asked for them AGAIN and I even screenshotted and linked them to you so you wouldn't miss it.

You still ignored them.

I asked you before that I can't be specific about syntax when I don't know your SkBee version, and you still -- after me asking twice -- haven't shared it.

Why would you go onto a forum if:
a.) You aren't going to listen to help
b.) You aren't going to give information that's required for the specific type of help you're asking for (which isn't necessary if you did section A).
c.) You're not even going to read my posts half the time.

Good luck. I hope someone else has the mountain of patience required to help you further.

Lord only knows the amount of frustration I've had to vent out from this thread alone.
:emoji_frowning:
Idk what my Skbee version is and I don't fully understand what you are saying