Death Chest Defense

Link to death-chest-defense

Importing the package

Link to importing-the-package

import mods.vanilladeathchest.DeathChestDefense;

ZenScript
Copy
//DeathChestDefense.setUnlocker(string stage, IItemStack unlocker);
DeathChestDefense.setUnlocker("example_stage", <minecraft:diamond_axe> * 1000);

A consumption/damage amount can be set by specifying a stack size like above.

Damage the unlocker item rather than consuming it

Link to damage-the-unlocker-item-rather-than-consuming-it

ZenScript
Copy
//DeathChestDefense.setDamageUnlockerInsteadOfConsume(string stage, bool flag);
DeathChestDefense.setDamageUnlockerInsteadOfConsume("example_stage", true);

Unlock failed chat message

Link to unlock-failed-chat-message

ZenScript
Copy
//DeathChestDefense.setUnlockFailedChatMessage(string stage, string message);
DeathChestDefense.setUnlockFailedChatMessage("example_stage", "You need to get a %2$s to unlock your chest!");

The string takes two arguments: the amount and display name of the required items.

ZenScript
Copy
//DeathChestDefense.setDefenseEntity(string stage, IEntityDefinition defenseEntity);
DeathChestDefense.setDefenseEntity("example_stage", <entity:minecraft:zombie_pigman>);

Defense entity NBT

Link to defense-entity-nbt

ZenScript
Copy
//DeathChestDefense.setDefenseEntityNBT(string stage, IData nbt);
DeathChestDefense.setDefenseEntityNBT("example_stage", {
    HandItems: [
        {
            Count: 1,
            id: "minecraft:diamond_sword"
        }
    ]
});

nbt should be a DataMap.

Defense entity spawn count

Link to defense-entity-spawn-count

ZenScript
Copy
//DeathChestDefense.setDefenseEntitySpawnCount(string stage, int count);
DeathChestDefense.setDefenseEntitySpawnCount("example_stage", 500);