your current location:首页 > news>ZU part wiki does not include function introduction [ZU] Zen Utils Minecraft Game

ZU part wiki does not include function introduction [ZU] Zen Utils Minecraft Game

2024-12-10 17:53:40|Myriagame |source:minecraft skins

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

This tutorial is suitable for authors who have a certain understanding of CRT. For more basic knowledge, please study other tutorials ~

Cot Expansion

DirectionalBlock

 Mods.ContentTweaker.VanillaFactory.CreateDirectionalBlock (UnLocalizedName as String, BlockMaterial As BlockMateria L, Directions As String, Planerotatable As Bool = False, PLACINGOPOSITE As BOOL = FALSE); 

Can create a rotatable block.UnlocalizedName is the uninvited name of the block.Blockmaterial is a square material.Directions is a type of steering: "ALL" represents that in 6 directions that can be rotated. "Horizontal" means that it can only rotate in the four directions of east, west, and north, and "vertical" can only rotate in both directions.Planerotatable indicates whether it can rotate horizontally.PLACINGOPOSITE means whether to face the player when placing.

Example:

 Val Blocka = MODS.CONTENTTTWEAR.VANILLAFACTORY.CREATEDIRECTIONALBLOCK ("Block_a", , "ALL", T. Rue, true);

blocka.blockhardness = 0.1;

blocka.blockResistance = 1.0;

blocka.blocksoundtype = ;

blocka.toolClass = "Pickaxe";

blocka.toollevel = 1;

blocka.register ();

Expanditem

 Mods.ContentTweaker.VanillaFactory.createExpanditem (unlocklyizedName as string); 

Can create an item.ExpandiTem extended itemRepRestation.This means that all Methods and Zenproperties that can be used for items can also be used for Expand items!

Zenproperties:

Attribute name

Type must fill in the default value description/comment

maxitemuseDuration

int

Non -0 items maximum use time atTackSpeed

Float

Attack speed AttackdamageFloat

Attack damage Destroyspeedfloat

Excavate speed EnchantabilityIint is not

Attachment ability

Example:

 Val Sworda = MODS.CONTENTTWEAKER. VanillaFactory.createExpandItem ("Sword_a");

sworda.maxstacksize = 1;

sworda.creativetab = ;

sworda.maxdamage = 1200;

sworda.toolClass = "Sword";

sworda.attackspeed = -2.4F; sworda.attackdamage = 50.0F;

sworda.register ();

Energystorage

EnergyStorage is an energy container that can change the energy in the container.

Obtain examples:

 MutableItemstack.enerGystorage //

World.GetenerGyStorage

Zengetters:

Zengetter type description/notes

maxnerGystored

INT maximum energy storage EnergyStoredint is currently energy storage

Canreeive

Can BOOL receive energy

cornextract

Can BOOL draw energy

ZenMethods:

 int Receivenergy (Energy As Int, Simulating as Bool) 

Enter energy in the energy container.Energy is the number of energy.SIMULATE indicates whether it is an analog input.Back to int represents the number of energy input.

 int Extractorgy (Energy As Int, Simulating as Bool) 

Pull the energy from the energy container.Energy is the number of energy.SIMULATE indicates whether it is drawn out.Back to int represents the number of energy that finally draws.

Example:

 Events.onplayerLeFTCLOCKBLOCK (Function (Event as Crafttweaker.event.playerftClickBlock)) {

Val w = event.World;

Val p = event.player;

Val I = Event.item;

If (! W.remote &&! Isnull (i) &&! P.Fake) {

If (! Isnull (I.Mutable (). EnergyStorage) {// If this item is an energy container

Value e = i.mutable (). Energystorage;

Print (e.canextract);

Print (e.canReceive);

Print (e.nergystored);

Print (E.MaxnerGyStored); E.Receivenergy (514, FALSE); // Enter 514RF

E.ExtraCtenergy (114, FALSE); // Pull out 114RF

}

}

});

Events.onPlayerLeftClickBlock (Function (event as crafttweaker.event.playerftClickBlock) {{{{) {{{{{{{{{{{{

Val w = event.World;

Val p = event.player;

VAL POS = Event.position;

If (! W.remote &&! P.fake) {

If (! Isnull (w.Getenergystorage (pOS, event.face))) {// If this block is an energy container

Value E = W.GetenerGystorage (POS, Event.face);

Print (e.canextract);

Print (e.canReceive);

Print (e.nergystored);

Print (E.MaxnerGystored);

E.receivenergy (514, false); // Enter 514RF

E.ExtraCtenergy (114, FALSE); // Pull out 114RF

}

}

});

Networkhandler

Other tutorials have been explained, please check [1.12.2] Simple NBT's manipulation and item dynamic information display (basically end) 3.4.1: networkhandler of zenutils!