Skip to content

Block

Represents a data-driven Block. MS Docs

Parameters

NameTypeDescription
identifierIdentifier
menu_categoryMenuCategory
componentsdict[str, BlockComponent]
eventsdict[Identifier, Event]
traitsdict[Identifier, BlockTrait]
statesdict[Identifier, list[str]]
sound_groupstr

Methods

Example

py
from mcaddon import *

blk = Block('test:on_interact_change_state_block')
blk.add_component(OnInteractComponent(event='test_event'))
blk.add_event('test_event', SetBlockProperty({'custom:direction': "1"}))
blk.save('block.json')

Not associated with or approved by Mojang Studios or Microsoft