Skip to content

@minecraft/server


@minecraft/server / BlockRecordPlayerComponent

Class: BlockRecordPlayerComponent ​

Defined in: @minecraft/server/index.d.ts:5390

Represents a block that can play a record.

Extends ​

Properties ​

block ​

readonly block: Block

Defined in: @minecraft/server/index.d.ts:4377

Remarks ​

Block instance that this component pertains to.

Inherited from ​

BlockComponent.block


isValid ​

readonly isValid: boolean

Defined in: @minecraft/server/index.d.ts:6234

Remarks ​

Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.

Inherited from ​

BlockComponent.isValid


typeId ​

readonly typeId: string

Defined in: @minecraft/server/index.d.ts:6240

Remarks ​

Identifier of the component.

Inherited from ​

BlockComponent.typeId


componentId ​

readonly static componentId: "minecraft:record_player" = 'minecraft:record_player'

Defined in: @minecraft/server/index.d.ts:5392

Methods ​

ejectRecord() ​

ejectRecord(): void

Defined in: @minecraft/server/index.d.ts:5402

Returns ​

void

Remarks ​

Ejects the currently set record of this record-playing block.

This function can't be called in restricted-execution mode.

Throws ​

This function can throw errors.


getRecord() ​

getRecord(): ItemStack | undefined

Defined in: @minecraft/server/index.d.ts:5409

Returns ​

ItemStack | undefined

Remarks ​

Gets the currently set record of this record-playing block.

Throws ​

This function can throw errors.


isPlaying() ​

isPlaying(): boolean

Defined in: @minecraft/server/index.d.ts:5417

Returns ​

boolean

Remarks ​

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

Throws ​

This function can throw errors.


pauseRecord() ​

pauseRecord(): void

Defined in: @minecraft/server/index.d.ts:5427

Returns ​

void

Remarks ​

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

This function can't be called in restricted-execution mode.

Throws ​

This function can throw errors.


playRecord() ​

playRecord(): void

Defined in: @minecraft/server/index.d.ts:5436

Returns ​

void

Remarks ​

Plays the currently set record of this record-playing block.

This function can't be called in restricted-execution mode.

Throws ​

This function can throw errors.


setRecord() ​

setRecord(recordItemType?, startPlaying?): void

Defined in: @minecraft/server/index.d.ts:5447

Parameters ​

recordItemType? ​

string | ItemType

startPlaying? ​

boolean

Defaults to: true

Returns ​

void

Remarks ​

Sets and plays a record based on an item type.

This function can't be called in restricted-execution mode.

Throws ​

This function can throw errors.