The block that this trait will be attached to.
Optional_options: JSONLikeObjectProtected ReadonlyblockThe block that this trait is attached to.
ReadonlycomponentThe block component that this trait is attached to.
Protected ReadonlydimensionThe dimension that the block is in.
ReadonlyidentifierThe identifier of the trait.
ReadonlystateThe block state key that this trait is attached to.
ReadonlytagThe block tag that this trait is attached to.
Static ReadonlycomponentThe block component that this trait is compatible with by default. If null, the trait will not attach to any block by default.
Static ReadonlyidentifierThe identifier of the trait.
Static ReadonlystateThe block state key that this trait is compatible with by default. If null, the trait will not be initialized by any block state.
Static ReadonlytagThe block tag that this trait is compatible with by default. If null, the trait will not attach to any block by default.
Static ReadonlytypesThe block type identifiers that this trait is compatible with by default.
ProtectedbreakBreaks the block on the next tick, dropping it, if it is still not held up then. Breaking a block updates its neighbours, so blocks held up by one another break one per tick, as in vanilla, rather than all at once, which spreads the work of breaking many blocks over many ticks.
Checks whether the block is held up.
Whether a block can hold up a hanging sign under it: any but blocks like air, and signs.
The block to check.
Whether a player at a position sees the front of the sign, rather than its back. The front faces the way the sign was put up: away from the wall it is on, or turned to face whoever put it up, on the floor or hanging from a ceiling.
The position the sign is seen from.
Get the back text of the sign.
The text on the back side of the sign, or an empty string if it doesn't exist.
Get the color of the back text of the sign.
The color of the back text as a Color instance.
Get the front text of the sign.
The text on the front side of the sign, or an empty string if it doesn't exist.
Get the color of the front text of the sign.
The color of the front text as a Color instance.
Gets which of sixteen steps around a sign turned to face a player points, as standing signs count them. 0 faces south, and each step turns a sixteenth of the way round, clockwise.
The player the sign faces.
Whether a block beside a hanging sign on a wall holds it up: any but blocks like air and signs, or another hanging sign on a wall, facing along the same line, which the signs then hang in.
The block beside the sign.
The direction the hanging sign faces; defaults to the direction this sign faces.
Whether a player clicking a face of this sign hangs the hanging sign they hold beside it, rather than editing it. This is the case for the sides of a hanging sign on a wall, which another hangs from in line with it; its front and back are the sides that are edited.
The player clicking the sign.
Optionalface: BlockFaceThe face of the sign the player clicked.
Whether the sign has been waxed, which keeps it from being edited.
Called when the trait is added to an object.
OptionalonCalled when the block is broken in the world.
Whether the block break was successful; default is true.
OptionalonCalled when a container that is attached to the block is updated.
The container that was updated.
Called when the block is interacted with by a player.
The options of the block interaction.
Whether the interaction was successful; default is true.
OptionalonCalled when a player pick blocks the block.
The player that picked the block.
Whether the player picked the block with a data request.
Called when the block is placed in the world.
The options of the block placement.
Whether the block placement was successful; default is true.
OptionalonCalled when the trait is random ticked by the dimension.
Called when the trait is removed from an object.
OptionalonOptionalonCalled when the block is started to be broken in the world.
The player that started to break the block.
OptionalonCalled when the block is stopped to be broken in the world.
The player that stopped breaking the block.
OptionalonCalled when the trait is ticked by the dimension.
The details about the tick event.
OptionalonCalled when the block is updated in the world.
Optionalsource: BlockThe source of the update, if any.
ProtectedplacePlaces a hanging sign against a face of a block, as vanilla does. Under a ceiling, it hangs from chains at its edges, facing away from the player, when the block above is solid; otherwise, or when the player sneaks, it hangs from one chain in its middle and turns in sixteen steps. Against a wall, it sticks out of the wall on a bracket, its faces at right angles to the wall. Hanging signs are not placed on top of a block.
The player placing the sign.
Optionalface: BlockFaceThe face of the block the sign was placed against.
Whether the sign was placed.
Set the back text of the sign.
The text to set on the back side of the sign.
Set the color of the back text of the sign.
The color to set for the back text.
Set the front text of the sign.
The text to set on the front side of the sign.
Set the color of the front text of the sign.
The color to set for the front text.
Sets the probability of this trait being randomly ticked each tick.
The numerator of the probability fraction.
The denominator of the probability fraction.
Wether this trait should be randomly ticked this tick.
A factor to multiply the chance by. Default is 1.
True if the trait should be randomly ticked, false otherwise.
Creates a new instance of the block trait.