Expansion for MCBlock

Additional methods for easier modification of block-related loot tables.

Methods

addDrop

Adds an IItemStack as a drop for this block.

Return Type: void

MCBlock.addDrop(uniqueId as string, stack as IItemStack) as void
ParameterTypeDescription
uniqueIdstringA unique identifier for this loot modifier.
stackIItemStackThe stack to add to the drops.
addDrops

Adds a list of IItemStacks as drops for this block.

Return Type: void

MCBlock.addDrops(uniqueId as string, stacks as IItemStack[]) as void
ParameterTypeDescription
uniqueIdstringA unique identifier for this loot modifier.
stacksIItemStack[]The stacks to add to the drops.
addLootModifier

Adds an ILootModifier to this block, with the given name.

Return Type: void

MCBlock.addLootModifier(name as string, modifier as ILootModifier) as void
ParameterTypeDescription
namestringThe name of the loot modifier to add.
modifierILootModifierThe loot modifier to add.
addStateDrop

Adds an IItemStack to the drops of this block if it matches the state outlined in the StatePropertiesPredicate.

Return Type: void

MCBlock.addStateDrop(uniqueId as string, statePredicate as Consumer<StatePropertiesPredicate>, stack as IItemStack) as void
ParameterTypeDescription
uniqueIdstringA unique identifier for this loot modifier.
statePredicateConsumer<StatePropertiesPredicate>A consumer to configure the StatePropertiesPredicate to identify the target state.
stackIItemStackThe stack to add to the drops.
addStateLootModifier

Adds an ILootModifier to this block, firing only if it matches the state outlined in the StatePropertiesPredicate.

Return Type: void

MCBlock.addStateLootModifier(name as string, statePredicate as Consumer<StatePropertiesPredicate>, modifier as ILootModifier) as void
ParameterTypeDescription
namestringThe name of the loot modifier to add.
statePredicateConsumer<StatePropertiesPredicate>A consumer to configure the StatePropertiesPredicate to identify the target state.
modifierILootModifierThe loot modifier to add.
addToolDrop

Adds an IItemStack to the drops of this block, if it gets broken with the given tool.

Parameters that may be attached the tool such as count, damage, or NBT data are ignored.

Return Type: void

MCBlock.addToolDrop(uniqueId as string, tool as IItemStack, stack as IItemStack) as void
ParameterTypeDescription
uniqueIdstringA unique identifier for this loot modifier.
toolIItemStackThe tool the block was broken with.
stackIItemStackThe stack to add to the drops.
addToolDrops

Adds a list of IItemStacks to the drops of this block, if it gets broken with the given tool.

Parameters that may be attached the tool such as count, damage, or NBT data are ignored.

Return Type: void

MCBlock.addToolDrops(uniqueId as string, tool as IItemStack, stacks as IItemStack[]) as void
ParameterTypeDescription
uniqueIdstringA unique identifier for this loot modifier.
toolIItemStackThe tool the block was broken with.
stacksIItemStack[]The stacks to add to the drops.
addToolLootModifier

Adds an ILootModifier that fires if this block gets broken with the given tool.

Parameters that may be attached to the tool such as count, damage, or NBT data are ignored.

Return Type: void

MCBlock.addToolLootModifier(name as string, tool as IItemStack, modifier as ILootModifier) as void
ParameterTypeDescription
namestringThe name of the loot modifier.
toolIItemStackThe tool the block was broken with.
modifierILootModifierThe loot modifier to add to the block.
addToolLootModifier

Adds an ILootModifier that fires if this block gets broken with the given tool, optionally considering its damage.

Additional parameters that may be attached to the tool, such as NBT or count, are ignored.

Return Type: void

MCBlock.addToolLootModifier(name as string, tool as IItemStack, matchDamage as boolean, modifier as ILootModifier) as void
ParameterTypeDescription
namestringThe name of the loot modifier.
toolIItemStackThe tool the block was broken with.
matchDamageboolean型Whether to consider damage or not when trying to match the tool.
modifierILootModifierThe loot modifier to add to the block.
addToolLootModifier

Adds an ILootModifier that fires if this block gets broken with the given tool, optionally considering its damage or NBT.

Additional parameters that may be attached to the tool, such as count, are ignored.

Return Type: void

MCBlock.addToolLootModifier(name as string, tool as IItemStack, matchDamage as boolean, matchNbt as boolean, modifier as ILootModifier) as void
ParameterTypeDescription
namestringThe name of the loot modifier.
toolIItemStackThe tool the block was broken with.
matchDamageboolean型Whether to consider damage or not when trying to match the tool.
matchNbtboolean型Whether to consider NBT data or not when trying to match the tool.
modifierILootModifierThe loot modifier to add to the block.