Casts
Overview
Objects retrieved from NovoScript can be casted to higher-level objects, if they are inheriting the base object. It's similar to the way Java does it.
For example, if you have an Entity object, retrieved from mc.theWorld.getLoadedEntityList()
, you can check if the object is of type EntityLivingBase
, cast it to the higher-level object and retrieve the newly-assigned properties:
Required Methods
Type | Name | Description | Signature |
---|---|---|---|
function | as | Casts an object (T) to the object's inherit ( | ? extends T(string) |
function | is | Checks if an object can be casted to a higher type. | boolean(string) |
Last updated