class Rosegold::Entity

Defined in:

rosegold/world/entity.cr

Constant Summary

METADATA_12111 = Array(Metadata).from_json(Rosegold.read_game_asset("1.21.11/entities.json"))
METADATA_1218 = Array(Metadata).from_json(Rosegold.read_game_asset("1.21.8/entities.json"))
METADATA_261 = Array(Metadata).from_json(Rosegold.read_game_asset("26.1/entities.json"))
METADATA_BY_PROTOCOL = {772_u32 => METADATA_1218, 774_u32 => METADATA_12111, 775_u32 => METADATA_261}
NON_PICKABLE_ENTITIES = Set {"item", "experience_orb", "area_effect_cloud", "marker", "block_display", "item_display", "text_display", "lightning_bolt", "evoker_fangs", "ominous_item_spawner", "eye_of_ender", "arrow", "spectral_arrow", "trident", "fireball", "small_fireball", "dragon_fireball", "wither_skull", "snowball", "egg", "ender_pearl", "experience_bottle", "splash_potion", "lingering_potion", "llama_spit", "wind_charge", "breeze_wind_charge", "firework_rocket", "fishing_bobber"}

Matches vanilla MC's Entity.isPickable() = false. Default is pickable; only these are excluded.

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(entity_id : UInt32, uuid : UUID, entity_type : UInt32, position : Rosegold::Vec3d, pitch : Float32, yaw : Float32, head_yaw : Float32, velocity : Rosegold::Vec3d, on_ground : Bool = true, living : Bool = false) #

[View source]

Class Method Detail

def self.metadata_for_protocol : Array(Metadata) #

[View source]

Instance Method Detail

def bounding_box #

[View source]
def effects : Array(EntityEffect) #

[View source]
def effects=(effects : Array(EntityEffect)) #

[View source]
def entity_id : UInt32 #

[View source]
def entity_id=(entity_id : UInt32) #

[View source]
def entity_type : UInt32 #

[View source]
def entity_type=(entity_type : UInt32) #

[View source]
def head_yaw : Float32 #

[View source]
def head_yaw=(head_yaw : Float32) #

[View source]
def living=(living : Bool) #

[View source]
def living? : Bool #

[View source]
def metadata #

[View source]
def on_ground=(on_ground : Bool) #

[View source]
def on_ground? : Bool #

[View source]
def passenger_ids : Array(UInt32) #

[View source]
def passenger_ids=(passenger_ids : Array(UInt32)) #

[View source]
def pickable? #

Mirrors vanilla MC's Entity.isPickable().


[View source]
def pitch : Float32 #

[View source]
def pitch=(pitch : Float32) #

[View source]
def position : Vec3d #

[View source]
def position=(position : Vec3d) #

[View source]
def update_passengers(client) #

[View source]
def uuid : UUID #

[View source]
def uuid=(uuid : UUID) #

[View source]
def velocity : Vec3d #

[View source]
def velocity=(velocity : Vec3d) #

[View source]
def yaw : Float32 #

[View source]
def yaw=(yaw : Float32) #

[View source]