your current location:首页 > news>[1.18] Use CRT to achieve switched anti -cheating [CRT] CRAFTTWEAKER MINECRAFT Game

[1.18] Use CRT to achieve switched anti -cheating [CRT] CRAFTTWEAKER MINECRAFT Game

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

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

Some of the integration packs we are familiar with (such as Flying Road 3, Greedy Integrated Pack) have to stop some cheating behaviors. The author may want to follow the rules of the game set, but there are always players who will not accept:

"I just want to add the XX module, how can I want to do it?"

Therefore, it is possible to teach how to bypass the anti -cheating by sending videos and the like to resist the author's behavior. The author does not like to see this, and many players are not willing to see it.

In this case, I think of another way to prevent this:

—— Take the road of others and let others have no way to go.


This is the theme I want to say. Using CRT to achieve the anti -cheating of switched can be used. Players do not want anti -cheating to let them check themselves.

The realization is actually very simple, the general idea is:

Give a variable that is used to store anti -cheating switches, and then use this to control the anti -cheating switch.It's that simple.

According to my habits, first create a ZS file as a variable proxy.

 Public Class Proxyvar {

Public static var cheat as bool = false; // Whether it can be cheated, the default value is false, which can be modified in the future

}

Then you can create another ZS to store things related to cheating.

{if class that = "assh: java;">> if (proxyvar.cheat == false) {

// Fill in anti -cheating related code

}

Oh yes, it is easy for players to switch to cheating.

 proxyvar.cheat = false; 

Put this alone as a config.

But do I think it ’s not beautiful, so I prefer this, creating a ZS as an agent for CONFIG:

 Public Function Enablecheat (Cheat As Bool) as void {

Proxyvar.cheat = cheat;

}

Function modified with Public in ZC (ZenCode) can be directly called by all scripts, so your config can be written directly:

 // Whether it can be cheated to cheat, false is not cheating and defaults to False

enablecheat (false);

Of course, the above code does not have to write like this, but this is my habit.

Because the player does not directly manipulate the value in the PROXYVAR, even if the Config blindly changes, the ERROR will not have a big problem, and it will directly use the set default value. Therefore, it is best not to use Proxyvar directly as config for players.

Based on this idea, various configurations can also be provided in Config to adjust the collocation package, as long as the author is not troublesome.(For example, set the number of output items)