BlockRecordPlayerComponent Class

Caution

This class is still in pre-release. Its signature may change or it may be removed in future releases.

Extends

Represents a block that can play a record.

Methods

clearRecord

clearRecord(): void

Clears the currently playing record of this record-playing block.

Important

This function can't be called in read-only mode.

Warning

This function can throw errors.

isPlaying

isPlaying(): boolean

Returns true if the record-playing block is currently playing a record.

Returns boolean

Warning

This function can throw errors.

setRecord

setRecord(recordItemType: ItemType | string): void

Sets and plays a record based on an item type.

Parameters

Important

This function can't be called in read-only mode.

Warning

This function can throw errors.

Constants

componentId

static read-only componentId = "minecraft:recordPlayer";

Type: string