your current location:首页 > news>About Crafttweaker Events for Mengxin's entry tutorial [CRT] CRAFTTWEAKER MINECRAFT Game

About Crafttweaker Events for Mengxin's entry tutorial [CRT] CRAFTTWEAKER MINECRAFT Game

2024-12-10 17:50:12|Myriagame |source:minecraft skins

I believe that many Mengxin (such as me) watched a half -knowledge when seeing CRT's official wiki, and dizzy about the incident.So I plan to make a simple framework directly, so that Mengxin, which you don't understand, can be copied directly.

To say less nonsense, the code:

 Import Crafttweaker.event.

Import crafttweaker.event.ieventcanceLable; // If you want to close the event, you need to import this package

events. ) {) {) {

// Fill in the events you need to execute here. You can find some in other tutorials according to the gourd painting scoop. All kinds of Zensetter and Zengetter can be used

}

});

It can be used after adjustment.The event name can

The following is an example:

 Import Crafttweaker.event.playrtickevent;

Import Crafttweaker.event.ieventCanceLable;

import crafttweaker.player.iplayer;

import crafttweaker.entity.ientitylivingbase;

Events.onPlayertick (Function (Event as Playrtickevent) {{

Var Player as iPlayer = EVENT.Player;

Var health = event.player.health;

If (health <20.0) {

Player.addpotionEffect ( .makePotionEffect (1, 1));

}

If (health <= 15.0) {

If (health> 10.0) {

Player.addpotionEffect ( .makePotionEffect (1, 100));;);

}

If (health <10.0) {

Player.addpotionEffect ( .makePotionEffect (1, 1));

}

}

});

You can understand this in English probably ()