Closed Remixful closed 6 years ago
Well, since the entity is spawned everytime the server init (or a word init), you would want to store the uuid when the server shutdown and when the server starts again, you search all entities with given uuid. Like
on skript unload:
loop {AllEntities::*}:
add uuid of loop-value to {AllEntitiesUUID::*}
clear {AllEntities::*}
on skript load:
wait a tick
loop all entities:
loop {AllEntitiesUUID::*}:
if uuid of loop-entity-1 is loop-value-2:
add loop-entity-1 to {AllEntities::*}
clear {AllEntitiesUUID::*}
I've already tried UUID of entity before posting this and I just assumed it only existed for players since it returns none.
loop all entities:
broadcast "%uuid of loop-value% %loop-value%"
Though the pattern stated in http://bensku.github.io/Skript/expressions.html is:
[the] UUID of %entities/offlineplayers/worlds%
Do you have the latest build of Skript?
I just updated spigot but I doubt that means anything. I am using 1.11.2 by the way.
Plugins
I also no longer seem to be able to retrieve entity UUIDs, even just looking at one and running send "%uuid of target%"
as an effect command is now returning "<none>"
.
As a temporary solution, I can use entity uuid of %entity%
, which is from an addon (not sure which because the only one that has that syntax registered in the skUnity docs is Umbaska, which I don't have installed). You have basically all of the same addons as I do, though, so you probably have that expression available to you as well.
Thank you so much @TheBentoBox! entity uuid of %entity%
works great. The UUID even remains the same after restarting the server.
@TheBentoBox It's Skellett's actually. But it's a shame it's not working in vanilla Skript.
No problem @Remixful, glad it's working. I figured it might be Skellett's, since that expression also used to be in RandomSK, which Lime has been trying to entirely port into Skellett. But yeah, it should be fixed here too, it's definitely not working at the moment as far as I can tell.
@Syst3ms It was working when I sent it to Skript, I also made a tons of checking to make sure it was working when using a variable. I will need to check again if it wasn't a bug somewhere else
UUID of entity expression stopped working, because enabling it broke offline player UUIDs. They both cannot work until an old parser issue (has been there for at least a year) is fixed.
Maybe change the expression to not use the same syntax? Instead of just being uuid of %entity/player/world%
, it could be entity uuid of %entity%
like in some addons. That way it wouldn't conflict with the current syntax.
Not sure when, but this was fixed (tested).
@Snow-Pyon dev30 fixed the parser bug, I think it was that.
I'm trying to find the best way to reference entities for future use (in a global list). Simply adding the entity to a list will just end up null in the variables file. Can anyone give me some ideas on how to achieve this?