A script that prevents players from cheating in certain Minecraft: Bedrock Edition servers.
-
Get the
mcpack
orzip
file of a release -
Install it normally
- Make sure you have
world_behavior_packs.json
in your server world, add this:
[
{
"pack_id" : "7fb4654b-7c4c-4aae-b116-4145a6125f74",
"version" : [ 2, 0, 0 ]
}
]
- Add the behavior pack to
behavior_packs
ordevelopment_behavior_packs
of your server folder
- Download the standalone version of a release
- Place the folder in
bdsx
folder (or wherever you put your scripts) - Add
require './gcd'
in yourindex.js
Current Instructions:
-
Clone or download the
zip
file -
Build the typescript project normally (by running
webpack
), also make sure you download npm typescript and webpack first -
Either leave the scripts in the addon, or as a standalone version
-
It should be built in the
dist/addon/scripts/server
. If using addon, no need to include thenbt.js
and other ones that need a modded server, but the standalone script should be backwards compatible with an addon
You can use an external server script (can be in an addon too) to listen when a player is flagged, and cancel it when needed, example:
require('./gcd'); // if in addon, best to place the listener in system.initialize
function onReach(data) {
console.log('Player failed reach, from external!')
console.log('Flag Data: ' + JSON.stringify(data));
if (data.distance < 4.00) return true; // returning true cancels the flag
var health = system.getComponent(data.target, "minecraft:health")
health.data.value = health.data.max;
system.applyComponentChanges(data.target, health);
return false;
}
server.__gcd_events__.flagged.connect('reach', onReach);
Note: there can be multiple listeners, the ones with priority are the first ones to be added
- If you click fast using knockback 2 on a player or entity, you will get false flagged