generated from QuiltMC/quilt-template-mod
-
Notifications
You must be signed in to change notification settings - Fork 3
Modifying Output Stacks
Skye Prince edited this page Apr 23, 2024
·
1 revision
By default, The Printer block entities attempt to clear item stacks' internal inventories (under the Items NBT key). However, if further customization is desired, there are two options:
-
Use the
theprinter:loses_datatag
Any items within this tag will have their NBT completely removed in the output stack. This is useful for clearing other mods' storage containers with unconventional internal inventory formats. -
Use the
PrinterOutputCreatedevent
This is a simple callback that provides the block entity along with the input stack and returns the output stack. For example, if you wanted to apply sharpness to every input diamond sword:
PrinterOutputCreated.EVENT.register((blockEntity, stack) -> {
if (stack.isOf(Items.DIAMOND_SWORD)) {
stack.addEnchantment(Enchantments.SHARPNESS, 1);
}
return stack;
});