Skip to content

Actors - Beta Components Module

anvil.beta.actors.components

EntityReflectProjectiles

Bases: Component

identifier property

Returns the identifier of the addon object in the format 'namespace:name'.

Returns:

Name Type Description
str Identifier

The identifier of the addon object.

name property

Returns the name of the addon object.

Returns:

Name Type Description
str str

The name of the addon object.

__export__()

Exports the component as a dictionary.

Returns:

Name Type Description
dict Dict[str, Any]

The exported component.

__init__(azimuth_angle=None, elevation_angle=None, reflected_projectiles=None, reflection_scale=None, reflection_sound='reflect')

[EXPERIMENTAL] Allows an entity to reflect projectiles.

Parameters:

Name Type Description Default
azimuth_angle Molang | str

[EXPERIMENTAL] A Molang expression defining the angle in degrees to add to the projectile's y axis rotation. Defaults to None.

None
elevation_angle Molang | str

[EXPERIMENTAL] A Molang expression defining the angle in degrees to add to the projectile's x axis rotation. Defaults to None.

None
reflected_projectiles list[MinecraftEntityDescriptor | Identifier]

[EXPERIMENTAL] An array of strings defining the types of projectiles that are reflected when they hit the entity. Defaults to None.

None
reflection_scale Molang | str

[EXPERIMENTAL] A Molang expression defining the velocity scaling of the reflected projectile. Values below 1 decrease the projectile's velocity, and values above 1 increase it. Defaults to None.

None
reflection_sound str

[EXPERIMENTAL] A string defining the name of the sound event to be played when a projectile is reflected. "reflect" unless specified. Defaults to "reflect".

'reflect'
Documentation reference

__iter__()

Iterates over the component's fields.

set_identifier_data(data)

Sets the data of the addon object.

Parameters:

Name Type Description Default
data any

The data to be set for the addon object.

required