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

ejectRecord

ejectRecord(): void

Important

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

Warning

This function can throw errors.

getRecord

getRecord(): ItemStack | undefined

Returns ItemStack | undefined

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.

pauseRecord

pauseRecord(): void

Important

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

Warning

This function can throw errors.

playRecord

playRecord(): void

Important

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

Warning

This function can throw errors.

setRecord

setRecord(recordItemType?: ItemType | string, startPlaying?: boolean): void

Sets and plays a record based on an item type.

Parameters

  • recordItemType?: ItemType | string = null
  • startPlaying?: boolean = true

Important

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

Warning

This function can throw errors.

Constants

componentId

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

Type: string