diff --git a/manifest.json b/manifest.json index 70c40ea..6a2875c 100644 --- a/manifest.json +++ b/manifest.json @@ -34,7 +34,7 @@ "Author": "JustSkyDev", "YouTube": "https://youtube.com/@JustSkyDev", "API": { - "Version": "1.0.2-pre-release", + "Version": "1.0.2-release", "URL": "https://github.com/JustSkyDev/Bedrock-API", "License": "MIT", "Download": { diff --git a/scripts/JS/@modules/handlers/entity/Entity.Class.js b/scripts/JS/@modules/handlers/entity/Entity.Class.js index c2188bd..1a21dee 100644 --- a/scripts/JS/@modules/handlers/entity/Entity.Class.js +++ b/scripts/JS/@modules/handlers/entity/Entity.Class.js @@ -31,7 +31,7 @@ class EntityClass { * @example getTags(); */ getTags() { - return this.entity.getTags(); + return this.entityObject.getTags(); } /** @@ -61,7 +61,7 @@ class EntityClass { ); const check = this.getTags()?.find((tag) => tag.startsWith(startswith)); - return check ? check : false; + return check; } } diff --git a/scripts/JS/@modules/handlers/entity/Player.Class.js b/scripts/JS/@modules/handlers/entity/Player.Class.js index 33141c8..ff70041 100644 --- a/scripts/JS/@modules/handlers/entity/Player.Class.js +++ b/scripts/JS/@modules/handlers/entity/Player.Class.js @@ -86,7 +86,7 @@ class PlayerClass extends EntityClass { * @returns {ItemStack|undefined} */ getRightItem() { - return this.container.getItem(this.playerObject.selectedSlot) ?? undefined; + return this.container.getItem(this.playerObject.selectedSlot); } /** @@ -102,20 +102,6 @@ class PlayerClass extends EntityClass { } return inventory; } - - /** - * Add enchantment to right hands item - * @param {ItemStack} item - Item stack - * @param {String|EnchantmentType} enchant - Enchant name - * @param {Number|undefined} level - Enchant level - */ - addRightEnchant(item, enchant, level = 1) { - const enchant = new Enchantment(enchant, level); - this.container.setItem( - this.playerObject.selectedSlot, - item.getComponent("enchantment").addEnchantment(enchant) - ); - } } export { PlayerClass }; diff --git a/scripts/JS/@modules/handlers/message/Failed.Class.js b/scripts/JS/@modules/handlers/message/Failed.Class.js index 27325b0..78e9bcc 100644 --- a/scripts/JS/@modules/handlers/message/Failed.Class.js +++ b/scripts/JS/@modules/handlers/message/Failed.Class.js @@ -14,7 +14,7 @@ class FailedClass { }, { translate: "commands.generic.unknown", - with: [`§f${commandName}§c`], + with: [`${commandName}`], }, ], }); diff --git a/scripts/JS/config.js b/scripts/JS/config.js index 3dc29d3..2f6e148 100644 --- a/scripts/JS/config.js +++ b/scripts/JS/config.js @@ -1,7 +1,7 @@ const Config = { defaultPrefix: "!", // Default custom command prefix disableWatchDog: true, // Change to true when your world crashes - version: "1.0.2-pre-release", + version: "1.0.2-release", }; export { Config }; diff --git a/scripts/JS/index.js b/scripts/JS/index.js index ba783b5..9992302 100644 --- a/scripts/JS/index.js +++ b/scripts/JS/index.js @@ -1,4 +1,4 @@ -// Index importer +// Index importer import { system } from "@minecraft/server"; import { Config } from "./config.js"; diff --git a/scripts/JS/plugins/Chat Ranks/system.js b/scripts/JS/plugins/Chat Ranks/system.js index b4d97af..7af5fc7 100644 --- a/scripts/JS/plugins/Chat Ranks/system.js +++ b/scripts/JS/plugins/Chat Ranks/system.js @@ -1,10 +1,15 @@ -import { system } from "@minecraft/server"; -import { BeforeEvents, PlayerClass, Timer, ChatClass } from "../class.chain.js"; +import { + Command, + BeforeEvents, + PlayerClass, + Timer, + ChatClass, +} from "../class.chain.js"; import { RankConfig } from "./config.js"; -BeforeEvents.on("send", async (data) => { +BeforeEvents.on("chat", async (data) => { const { message, sender } = data; - if (message.startsWith(API.Command.getPrefix())) return; + if (message.startsWith(Command.getPrefix())) return; data.cancel = true; const player = new PlayerClass(sender); const getRankTag = diff --git a/scripts/JS/plugins/Custom Commands/built-in/checkOnline.js b/scripts/JS/plugins/Custom Commands/built-in/checkOnline.js index b53d0be..ddb45e4 100644 --- a/scripts/JS/plugins/Custom Commands/built-in/checkOnline.js +++ b/scripts/JS/plugins/Custom Commands/built-in/checkOnline.js @@ -19,7 +19,9 @@ Command.BuildCommand(registration, (interaction) => { const player = new PlayerClass(sender); if (Validation.isUndefined(inputs.getInput(0))) - return sender.sendMessage("§cSeconds arguments cannot be empty"); + return sender.sendMessage( + "§cPlayername should be starts with @, like @PlayerName" + ); const checkPlayer = player.isOnline(inputs.getInput(0)); return sender.sendMessage( diff --git a/scripts/JS/plugins/Custom Commands/built-in/help.js b/scripts/JS/plugins/Custom Commands/built-in/help.js index ffe5189..0de2f2e 100644 --- a/scripts/JS/plugins/Custom Commands/built-in/help.js +++ b/scripts/JS/plugins/Custom Commands/built-in/help.js @@ -38,7 +38,7 @@ Command.BuildCommand(registration, (interaction) => { item.usage.length === 0 ? "No usage found" : item.usage.join(", ") }\n§7Example Usage: §f${ item.example.length === 0 ? "No example found" : item.example.join(", ") - }\n§a-------------------------` + }\n§a---------------------------` ); } else { const startIndex = ((inputs.getInput(0) ?? 1) - 1) * PAGE_LIMIT;