diff --git a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/manifest.json b/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/manifest.json deleted file mode 100644 index a82071a..0000000 --- a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/manifest.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "format_version": 2, - "header": { - "name": "Script Testing", - "description": "Beta API §cREQUIRED", - "uuid": "afaec5e8-41df-4c83-953c-d72d6d5096ca", - "min_engine_version": [ - 1, - 19, - 40 - ], - "version": [ - 1, - 0, - 0 - ] - }, - "modules": [ - { - "description": "Behavior Pack Module", - "type": "data", - "uuid": "112589f1-110e-430a-aa87-b87445ddd347", - "version": [ - 1, - 0, - 0 - ] - }, - { - "description": "Gametest Module", - "type": "script", - "language": "javascript", - "entry": "scripts/main.js", - "uuid": "ea607914-520e-4836-8b05-54d40c1cab28", - "version": [ - 1, - 0, - 0 - ] - } - ], - "dependencies": [ - { - "module_name": "@minecraft/server", - "version": "1.1.0-beta" - }, - { - "module_name": "@minecraft/server-ui", - "version": "1.0.0-beta" - } - ], - "metadata": { - "generated_with": { - "bridge": [ - "1.8.4" - ] - } - } -} \ No newline at end of file diff --git a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/pack_icon.png b/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/pack_icon.png deleted file mode 100644 index 6a44058..0000000 Binary files a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/pack_icon.png and /dev/null differ diff --git a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/index.js b/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/index.js deleted file mode 100644 index 215cb15..0000000 --- a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/index.js +++ /dev/null @@ -1,26 +0,0 @@ -import * as ui from "mojang-minecraft-ui" -import { world } from "mojang-minecraft" - -//Form Creation -let form1 = new ui.ActionFormData() -form1.title("Tutorial") -form1.body("Tutorial Body") -//start at 0 -form1.button("Creative mode") - -world.events.beforeItemUse.subscribe(eventdata => { - let player = eventdata.source - let item = eventdata.item - - if (item.id == "minecraft:compass") { - form1.show(player).then(result => { - let selection = result.selection - if (selection == 0) { - player.runcommand( - "gamemode c @s" - ) - } - } - // @ts-ignore - } -}) \ No newline at end of file diff --git a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/misc/afkDetection.js b/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/misc/afkDetection.js deleted file mode 100644 index fd44708..0000000 --- a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/misc/afkDetection.js +++ /dev/null @@ -1,76 +0,0 @@ -import { world } from '@minecraft/server'; -world.events.tick.subscribe(() => { - [...world.getPlayers()].forEach(player => { - if(player.hasTag("admin")) return; - else{ - player.runCommandAsync(`scoreboard players add @s afkTimer 1`); - const afkTimer = world.scoreboard.getObjective('afkTimer').getScore(player.scoreboard); - if(afkTimer > 5300){ - if(afkTimer == 5400) player.tell(`§6[§eSafeGuard§6] §l§4YOU WILL BE KICKED FOR AFK IN §c30§4 SECONDS!`); - else if(afkTimer == 5700) player.tell(`§6[§eSafeGuard§6] §l§4YOU WILL BE KICKED FOR AFK IN §c15§4 SECONDS!`); - else if(afkTimer == 5800) player.tell(`§6[§eSafeGuard§6] §l§4YOU WILL BE KICKED FOR AFK IN §c10§4 SECONDS!`); - else if(afkTimer == 5900) player.tell(`§6[§eSafeGuard§6] §l§4YOU WILL BE KICKED FOR AFK IN §c5§4 SECONDS!`); - else if(afkTimer == 5920) player.tell(`§6[§eSafeGuard§6] §l§4YOU WILL BE KICKED FOR AFK IN §c4§4 SECONDS!`); - else if(afkTimer == 5940) player.tell(`§6[§eSafeGuard§6] §l§4YOU WILL BE KICKED FOR AFK IN §c3§4 SECONDS!`); - else if(afkTimer == 5960) player.tell(`§6[§eSafeGuard§6] §l§4YOU WILL BE KICKED FOR AFK IN §c2§4 SECONDS!`); - else if(afkTimer == 5980) player.tell(`§6[§eSafeGuard§6] §l§4YOU WILL BE KICKED FOR AFK IN §c1§4 SECOND!`); - else if(afkTimer > 6000){ - stillHere(player); - player.runCommandAsync(`kick ${player.nameTag} §l§4Kicked for being §cAFK §4 || §c${new Date()}`); - world.say(`§6[§eSafeGuard Notify§6]§5§l §r§5${player.nameTag}§b Was kicked for being AFK§r`) - } - } - const {x, y, z} = player.velocity; - if(x > .15 || y > .43 || z > .15){ - stillHere(player); - } - - } - } -)}); - -world.events.playerJoin.subscribe(join => { - const player = join.player; - stillHere(player); - - }); - - -world.events.beforeItemUseOn.subscribe((data) => { - let {item} = data; - const player = data.source; - if (item) { - stillHere(player); - } -}); - -world.events.blockBreak.subscribe((data) => { - const player = data.player; - stillHere(player); -}); - - -world.events.beforeChat.subscribe((data) => { - const player = data.player; - stillHere(player); -}); - -world.events.entityHurt.subscribe((data) => { - - const damaged = data.hurtEntity; - const damager = data.damagingEntity; - - if(damager.typeId == "minecraft:player" && damaged.typeId == "minecraft:player" && damaged.getComponent("health").current <= 0){ - damager.runCommandAsync(`scoreboard players add @s kills 1`); - } - else if(damager.typeId == "minecraft:player"){ - stillHere(damager); - } -}); - - - - -function stillHere(player){ - player.runCommandAsync(`scoreboard players set @s afkTimer 1`); -} \ No newline at end of file diff --git a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/misc/chestLock.js b/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/misc/chestLock.js deleted file mode 100644 index 5f98a60..0000000 --- a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/misc/chestLock.js +++ /dev/null @@ -1,22 +0,0 @@ -import { EntityInventoryComponent, Items, ItemStack, MinecraftBlockTypes, MinecraftItemTypes, Player, world } from '@minecraft/server'; - -world.events.beforeItemUseOn.subscribe((event) => { - const player = event.source; - if (!(player instanceof Player)) return; - const block = player.dimension.getBlock( event.blockLocation ); - if(block.typeId == "minecraft:chest"){ - const inv = block.getComponent("minecraft:inventory").container; - const item = inv.getItem(0); - if(!item) return; - const itemName = item.nameTag ?? ''; - if(itemName.startsWith("chestOwner:")){ - if(itemName == `chestOwner:${player.nameTag}`){ - return; - } - else{ - event.cancel = true; - player.onScreenDisplay.setActionBar('§4§lChest is locked!'); - } - } -} -}); \ No newline at end of file diff --git a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/misc/combatlogging.js b/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/misc/combatlogging.js deleted file mode 100644 index a0fd580..0000000 --- a/Safeguard anti-cheat B/functions/punishment/freeze/Script Testing/scripts/misc/combatlogging.js +++ /dev/null @@ -1,42 +0,0 @@ -import { MinecraftEnchantmentTypes, EnchantmentList, world, EntityInventoryComponent , Player, ItemStack, MinecraftItemTypes, Items } from '@minecraft/server'; -const overworld = world.getDimension("overworld"); -world.events.entityHurt.subscribe((data) => { - try{ - const damaged = data.hurtEntity; - const damager = data.damagingEntity; - let inCombat = world.scoreboard.getObjective('in_combat').getScore(damager.scoreboard); - - const damagedHP = damaged.getComponent("health").current; - const damagerHP = damager.getComponent("health").current; - //if(player.typeId !== "minecraft:player" || damager.typeId !== "minecraft:player") return; - //damagedHP.runCommandAsync(`scoreboard players set @s in_combat 1200`); - if(!damager.typeId == "minecraft:player") return; - else{ - if(inCombat == 0){ - damager.tell(`now in combat!`); - } - damager.runCommandAsync(`scoreboard players set @s in_combat 1200`); - - } -}catch (error) {world.say("§l§4ERROR: §r"+ error)} -}); - - -world.events.tick.subscribe(() => { - [...world.getPlayers()].forEach(player => { - let plrName = player.name; - let inCombat = world.scoreboard.getObjective('in_combat').getScore(player.scoreboard); - player.runCommandAsync("scoreboard players remove @a[scores={in_combat=1..}] in_combat 1"); - if(inCombat == 1){ - player.tell("now out of combat!"); - } - }); -}); -world.events.playerJoin.subscribe(join => { - const player = join.player; - const inCombat = world.scoreboard.getObjective("in_combat").getScore(player.scoreboard); - if(inCombat > 1){ - world.say(player.name); - } - - }); \ No newline at end of file