Olyno / skent

Manage your files and folder with Skript
GNU General Public License v3.0
11 stars 2 forks source link

Spawning Mobs Inside of ASync Does Not Work #32

Closed MinecraftMan1013number2 closed 2 years ago

MinecraftMan1013number2 commented 2 years ago

Describe your problem

Spawning mobs does not work inside of something async.

Versions

Skript: 2.6.1 Server: Paper version git-Paper-"b8fa41e" (MC: 1.18.2) Skent: 3.1.0 image

Code

function RenameAndSpawn(oldPath: text, newName: text):
    set {_path} to file path "%{_oldPath}%"
    if {_path} is not missing:
        set {_p} to location of "MinecraftMan1013" parsed as a player
        rename file path "%{_oldPath}%" to "%{_newName}%":
            spawn 1 creeper at {_p}
            set {_z} to last spawned creeper
            set display name of {_z} to "Test Dummie"
            broadcast "spawned"
        broadcast "done"
    else:
        broadcast "requested file missing"

Result: image No mob was spawned at my location though.

Error

It did this once (I was using armor stands at the time), but not for my other tests. https://www.toptal.com/developers/hastebin/zolifopili

Olyno commented 2 years ago

Hi 👋🏻 Indeed, this is probably due to the async problem that is not possible to fix at the moment (at least not easily)

MinecraftMan1013number2 commented 2 years ago

Dang, that stinks. Is there any way around this problem?

Olyno commented 2 years ago

Except for spending a lot of time on it in order to have a good method and make it work properly, not really. You'll have to wait and be patient

MinecraftMan1013number2 commented 2 years ago

Ok, thanks.

Olyno commented 2 years ago

Should be fixed in the next release (3.2.0). Feel free to reopen the issue if you still have the issue.