Solved World's spawn location

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

salnwar

Member
Dec 24, 2018
11
0
1
24
Hello, I've search everywhere on the internet and I don't found how can i get the location of a specific world.

(if I don't find a solution with armor stand, I would try when a player join the world to generate my schematic)

My code:
code_language.skript:
#creating world

#teleport entity to my spawn in world "world"
spawn armor stand at {spawnloc}

#keep armor stand into a variable
set {_a} to last spawned entity

#this is a test to check if tp is working and it's working
#loop all players:
#     teleport loop-player to spawn of "%{_id}%"

#teleport the armor stand to spawn location of the world (using Skellett)
teleport {_a} to spawn of "%{_world}%"

#define the world's spawn
set {%{_id}%::spawnlocation} to {_a}'s location
      
broadcast "%{%{_id}%::spawnlocation}%"

#now i paste my schematic at last spawned entity (armor stand)
sharpsk fawe paste schematic "spawn" at {%{_id}%::spawnlocation}

#now I kill the armor stand
kill {_a}

And I don't have any error in the server's console.

Thanks for you helping.

UPDATE:
It's doesn't work because the chunk have to be loaded.. Now I search how I can do to pre-loaded chunk.
 
Last edited:
Maybe this will work
code_language.skript:
        set {_chunk} to chunk at location of {spawnloc}
        load chunk {_chunk}

Thank you, but I don't know how to get the spawn location of the created world.. I only know how teleport a player on the world's spawn location.
 
Thank you, but I don't know how to get the spawn location of the created world.. I only know how teleport a player on the world's spawn location.
If you spawn a entity in that created world just set a variable to the location of the entity maybe that will get you the spawn location
 
If you spawn a entity in that created world just set a variable to the location of the entity maybe that will get you the spawn location

I have already do that but when i get the entity's location it's not the location in the new world but the location of the main world... This is my problem
 
It didn't work, the schematic is not pasted

code_language.skript:
spawn armor stand at {spawnloc}
set {_a} to last spawned entity
teleport {_a} to spawn of "%{_id}%"
set {%{_id}%::spawnlocation} to {_a}'s location

set {_chunk} to chunk at location of {_a}
load chunk {_chunk}

sharpsk fawe paste schematic "structure" at {%{_id}%::spawnlocation}
kill {_a}

EDIT:

And the
code_language.skript:
{_a}'s location
still the same as
code_language.skript:
{spawnloc}

[doublepost=1545674694,1545674348][/doublepost]And now I have this error

Java:
[18:59:37] [Craft Scheduler Thread - 64/WARN]: [FastAsyncWorldEdit] Plugin FastAsyncWorldEdit v18.12.19-d131fa6-1241-22.0.3 generated an exception while executing task 267java.lang.NullPointerException: null
at me.sharpjaws.sharpSK.hooks.FAWE.EffFAWEPasteSchematic$1.run(EffFAWEPasteSchematic.java:71) ~[?:?]
at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:63) ~[patched_1.12.2.jar:git-Paper-1594]
at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:52) ~[patched_1.12.2.jar:git-Paper-1594]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.12.2.jar:git-Paper-1594]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_192]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_192]
at java.lang.Thread.run(Thread.java:813) [?:1.8.0_192]
 
Are you sure the schematic exists?
 
Maybe try using this..
code_language.skript:
            set {_world} to {spawnloc}'s world
            set {_x} to x-coordinate of {spawnloc}
            set {_y} to y-coordinate of {spawnloc}
            set {_z} to z-coordinate of {spawnloc}
            set {_loc} to the location at {_x}, {_y}, {_z} of the world {_world}
 
Thanks to you for answer me but, it's doesn't work. If you don't have understand my request: I would like paste a schematic into a world (not the default) and I don't know how I can paste my schematic directly in the spawn location of a specific world. I have try with a entity (armor stand), teleport him to the targeted world spawn and get entity's location to paste my schematic but it didn't work, the entity doesn't been teleported.

I ask you if you have others solutions for this.
 
That is as simple as:
code_language.skript:
sharpsk fawe paste schematic "structure" at spawn of "myworld" # of course, change "structure" to the actual schem name and "myworld" to the world name
 
I decided to using SkStuff's expression to paste my schematic, It's working better. Thanks you to have helping me. I turn the thread to "solved".

This is my code (for anyone would like to do the same thing):
code_language.skript:
set {_world} to {_id} parsed as world #{_id} is my string
set {_session} to new edit session in {_world} with limit -1
paste schem "plugins/WorldEdit/schematics/hg_spawn" at spawn of {_world} using {_session}
 
Status
Not open for further replies.