Implement entity function#8540
Conversation
|
Ah , I would have expected a NPE if you pass null to getEntity. The null check is good practice anyway, so looks good. Will review tomorrow |
Any argument being null while not being marked as optional results in any DefaultFunction returning null, so it's not actually necessary |
Accidentally typed some characters while alt tabbing, it happened after I did a quickTest so I didn't notice it
Oh right, forgot you updated that |
Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
| "set {_entity} to entity({uuid})", | ||
| "kill entity({uuid})", | ||
| "set {_type} to type of entity({uuid})" |
There was a problem hiding this comment.
when i said better examples i mean giving actual examples of uuids, using a literal string, or things like that, rather than just handwaving {uuid} each time.

Problem
There are functions to get players and offline players from a uuid, but not for other entities. Having one would also make it easier to convert a uuid to an entity.
Solution
Added a new function entity(UUID) which returns the entity with the given uuid
Testing Completed
Quicktest and a bit of manual testing were done (the manual testing was mostly just "broadcast entity(uuid of last spawned entity)")
Supporting Information
Completes: #8488
Related: none
AI assistance: none