Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Ancient Warfare 2
- // Research Book Recipe Unlock
- // CraftTweaker 1.12.2 Script
- // written by Axebeard2025
- // Last Updated: 03/16/2020
- //
- // This script unlocks the Ancient Warfare Research Book
- // in the Minecraft Vanilla recipe book when the player
- // crafts or picks up an iron ingot, leather, or paper.
- //
- // This script does not unlock the Research Book when
- // an iron ingot, leather, or paper is given to the
- // player by a mod, console command or console block.
- // Also, this script does not work when the player is
- // in creative mode
- // PLAYER CRAFTED EVENTS CHECK
- events.onPlayerCrafted(function(event as crafttweaker.event.PlayerCraftedEvent) { // Casts the crafttweaker.event.PlayerCraftedEvent into the function header
- if(event.output.definition.id == "minecraft:paper"){ // Checks if item crafted is minecraft:paper
- server.commandManager.executeCommand(server, "recipe give @p ancientwarfare:core/research_book"); // If paper is crafted, then player is given the recipe for AW2 Research Book
- }
- if(event.output.definition.id == "minecraft:leather"){ // Checks if item crafted is minecraft:leather
- server.commandManager.executeCommand(server, "recipe give @p ancientwarfare:core/research_book"); // If leather is crafted, then player is given the recipe for AW2 Research Book
- }
- if(event.output.definition.id == "minecraft:iron_ingot"){ // Checks if item crafted is minecraft:iron_ingot
- server.commandManager.executeCommand(server, "recipe give @p ancientwarfare:core/research_book"); // If iron ingot is crafted, then player is given the recipe for AW2 Research Book
- }
- });
- // PLAYER PICK UP ITEM EVENTS CHECK
- events.onPlayerPickupItem(function(event as crafttweaker.event.PlayerPickupItemEvent) { // Casts the crafttweaker.event.PlayerPickupItemEvent into the function header
- if(event.item.item.definition.id == "minecraft:paper"){ // Checks if item picked up is minecraft:paper
- server.commandManager.executeCommand(server, "recipe give @p ancientwarfare:core/research_book"); // If paper is picked up, then player is given the recipe for AW2 Research Book
- }
- if(event.item.item.definition.id == "minecraft:leather"){ // Checks if item picked up is minecraft:leather
- server.commandManager.executeCommand(server, "recipe give @p ancientwarfare:core/research_book"); // If leather is picked up, then player is given the recipe for AW2 Research Book
- }
- if(event.item.item.definition.id == "minecraft:iron_ingot"){ // Checks if item picked up is minecraft:iron_ingot
- server.commandManager.executeCommand(server, "recipe give @p ancientwarfare:core/research_book"); // If iron ingot is picked up, then player is given the recipe for AW2 Research Book
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement