Use COT custom objects

This tutorial is set by the author to use the CC by-NC protocol.

This is a tutorial about the ContentTweaker (hereinafter referred to as COT), and some of the information comes from the CRTWIKI of Youyihj's big guy.

You need to install the following mod to start the COT.

Crafttweaker (front), ContentTweaker (ontology), Justness (Jei, CRT front), B.A.S.E (front, 1.16.5 need not be installed).


Step 1: Start the game

The role is to load the CRT module to make the .minecraft/scripts appear.


Step 2: Basic operation

Create a new suffix name in the scripts folder. ZS (although the name is casual, it is recommended to use item, block, FLUID name to classify the file), or you can also put it in a new COT subfaming folder in your newly built.


Step 3: Start Demon Reform (Items)

Use your favorite text editor (recommended vscode here) to open the .zs file you just created, please enter at the beginning, please enter

#Loader ContentTweaker (meaning that this script is loaded by COT)

Import Mods.ContentTWEAKER. VanillaFactory;

Import Mods.ContentTWEAKER.Item; (This is a package that introduces custom items)

VAL COTITEM as item = vanillaFactory.createItem ("COT_ITEM");

cotItem.register (); (indicate to register this item)

Of course, it is impossible for items to be only these labels (the label information is provided in the gitbook of Youyihj's gang), and the format of all tags is

Item name. Tag name = value;

name

Type default value describes BeaconPayment

Can BOOLFALSE be put in the beacon

Creativetab

ICreativeTabMISC creates labels

Set the creation label where the item is located, remember

GlowingBoolfalse is there any magic light MaxDamage

INT-1 is durable, less than 0 is ordinary items, and greater than 0 will be regarded as a tool

maxstacksize

int64

Set the maximum stack of items

Rarity

Enumrarity

Common

Set the scarcity of items, which will affect the color of the name display name. You can use ("Common", "Uncommon", "Rare", "EPIC")

ToolclassStringnull Sets what tools are this (Pickaxe, Axe Ax, etc.), it seems that the Sword Sword cannot

Toollevel

INT-1 setting tool mining level

A simple example script.

#priority 1

#Loader ContentTweaker

Import Mods.ContentTweaker.Vanillafactory;

Import Mods.ContentTWEAKER.ITEM;

VAL COTITEM as item = vanillafactory.createitem ("Cot_item");

cotitem.rarity = "epic";

cotItem.creativetab = ;

cotItem.beaConPayment = true;

CotItem.maxstacksize = 999;

cotitem.register ();

After writing, save+close, restart the game, and you will see items in the creative tabs you choose at this time.What?Do you say that there is no material?The name is also garbled?Don't worry, look at the next step.


Step 4: Material and localization.

Please put the material in Resources/ContentTweaker/Textures/items. The file name is the name of the item .png, which is the name within the dual quotes.

Localization, please open the Resources/ContentWeaker/Lang to find your en_us.lang file, copy, and rename the replication to zh_cn.lang.Open zh_cn.lang Enter the localized key: item.contenttweaker. Item id.name = Chinese name, and exit after saving.

If you want to add English names, open en_us.lang Input: item.contenttweaker. The name of the item .Name = English name.

If you say other strange language friends, just follow the above operations.

Thank you for watching this tutorial, I will update it immediately.