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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
function getUUID(e: entity) :: text:
return "%{_e}.getUniqueId()%"
command /entityID:
trigger:
message "%getUUID(target entity)%"
on script load:
import "java.util.UUID"
I believe Umbaska has an Entity UUID expression; however, I don't know how/if it works, as I've never used it.
However, I've never used it before, and I'm not entire sure if Umbaska is still a thing?
[doublepost=1500627649,1500622449][/doublepost]You could also do something like this with Skript-mirror:
code_language.skript:function getUUID(e: entity) :: text: return "%{_e}.getUniqueId()%" command /entityID: trigger: message "%getUUID(target entity)%" on script load: import "java.util.UUID"
spawn armor stand at player's location
set {_a} to spawned entity
How could I use this?
Example:
code_language.skript:spawn armor stand at player's location set {_a} to spawned entity
How can I make that {_a} detect it as uuid?
If I do while {_a} exists:
At the moment when the chunk where {_a} is unloaded, that entity no longer exists but is still there.
I hope you have understood me
function getUUID(e: entity) :: text:
return "%{_e}.getUniqueId()%"
function getEntity(uuid: text) :: entity:
loop all entities where ["%getUUID(entity input)%" contains "%{_uuid}%"]:
return loop-entity
return null
command /entityID:
trigger:
set {_uuid} to getUUID(target entity)
set {_entity} to getEntity({_uuid})
broadcast "%{_entity}%"
on script load:
import "java.util.UUID"
I think I understand; so you want to use the entity's uuid to save it, then also get the entity from the uuid previously saved.
Now, according to this, there is no built in function to return an entity from a uuid; however, we can work around that via loops:
code_language.skript:function getUUID(e: entity) :: text: return "%{_e}.getUniqueId()%" function getEntity(uuid: text) :: entity: loop all entities where ["%getUUID(entity input)%" contains "%{_uuid}%"]: return loop-entity command /entityID: trigger: set {_uuid} to getUUID(target entity) set {_entity} to getEntity({_uuid}) broadcast "%{_entity}%" on script load: import "java.util.UUID"
I added a function called "getEntity", which, given a uuid, will return an entity.
Thanks!!
lol vanilla skript can do entity uuids.I think I understand; so you want to use the entity's uuid to save it, then also get the entity from the uuid previously saved.
Now, according to this, there is no built in function to return an entity from a uuid; however, we can work around that via loops:
code_language.skript:function getUUID(e: entity) :: text: return "%{_e}.getUniqueId()%" function getEntity(uuid: text) :: entity: loop all entities where ["%getUUID(entity input)%" contains "%{_uuid}%"]: return loop-entity return null command /entityID: trigger: set {_uuid} to getUUID(target entity) set {_entity} to getEntity({_uuid}) broadcast "%{_entity}%" on script load: import "java.util.UUID"
I added a function called "getEntity", which, given a uuid, will return an entity.
lol vanilla skript can do entity uuids.
lol vanilla skript can do entity uuids.
command /entityID:
trigger:
broadcast "%uuid of target entity%" # returns null
https://github.com/bensku/Skript/pull/373Can you give me an example of the syntax? I couldn't find anything in the docs about it.
[doublepost=1500686484,1500684356][/doublepost]
I saw SkUnity's UUID expression that does not state spawnable entities as a valid input, and I assumed Skript did't have the expression for spawnable entities.
In addition, I saw the same expression on Bensku's Fork's docs, but it returned null using the following example:
code_language.skript:command /entityID: trigger: broadcast "%uuid of target entity%" # returns null
Don't work