diff --git a/SECURITY.md b/SECURITY.md index 68bdeb0..e0546a1 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,9 +1,8 @@ -| Version | Supported | -| ------- | ------------------ | -| 1.2.5 | :heavy_check_mark: | -| 1.2.4 | :x: | -| 1.2.3 | :x: | +| Version | Supported | Mc Version Supported | +| ------- | ------------------ |---------| +| 1.2.5.1 | :heavy_check_mark: | 1.20.51 | +| 1.2.5 | :heavy_check_mark: | 1.20.82 | Warnings -- any version before 1.2.4 is not supported +- any version before 1.2.4 is not supported but they work for the older version of minecraft diff --git a/nBehavior/entities/jutsu/fireball_jutsu.entity.json b/nBehavior/entities/jutsu/fireball_jutsu.entity.json index e91a1eb..ed6e892 100644 --- a/nBehavior/entities/jutsu/fireball_jutsu.entity.json +++ b/nBehavior/entities/jutsu/fireball_jutsu.entity.json @@ -1,5 +1,5 @@ { - "format_version": "1.20.0", + "format_version": "1.20.52", "minecraft:entity": { "description": { "identifier": "naruto:fireball_jutsu", diff --git a/nBehavior/entities/weapons/shuriken.json b/nBehavior/entities/weapons/shuriken.json index 921b0d0..97f8f13 100644 --- a/nBehavior/entities/weapons/shuriken.json +++ b/nBehavior/entities/weapons/shuriken.json @@ -1,5 +1,5 @@ { - "format_version": "1.20.0", + "format_version": "1.20.51", "minecraft:entity": { "description": { "identifier": "naruto:shuriken", diff --git a/nBehavior/items/weapons/katana.item.json b/nBehavior/items/weapons/katana.item.json index 9fa6b55..dfc34c5 100644 --- a/nBehavior/items/weapons/katana.item.json +++ b/nBehavior/items/weapons/katana.item.json @@ -1,5 +1,5 @@ { - "format_version": "1.20.0", + "format_version": "1.20.51", "minecraft:item": { "description": { "identifier": "naruto:katana", @@ -11,9 +11,12 @@ "components": { "minecraft:max_stack_size": 1, "minecraft:icon": { - "texture": "katana" + "texture": "katana", + "minecraft:creative_category": { + "parent": "itemGroup.name.sword" + } }, - "minecraft:damage": 7, + "minecraft:damage": 6.5, "minecraft:can_destroy_in_creative": false, "minecraft:hand_equipped": true, "minecraft:durability": { @@ -22,7 +25,9 @@ "minecraft:repairable": { "repair_items": [ { - "items": ["iron_ingot"], + "items": [ + "iron_ingot" + ], "repair_amount": 62 } ] diff --git a/nBehavior/items/weapons/shuriken.item.json b/nBehavior/items/weapons/shuriken.item.json index 9c4cad0..3c7f75a 100644 --- a/nBehavior/items/weapons/shuriken.item.json +++ b/nBehavior/items/weapons/shuriken.item.json @@ -1,5 +1,5 @@ { - "format_version": "1.20.0", + "format_version": "1.20.51", "minecraft:item": { "description": { "category": "equipment", diff --git a/nBehavior/recipes/katana.recipe.json b/nBehavior/recipes/katana.recipe.json new file mode 100644 index 0000000..4db108e --- /dev/null +++ b/nBehavior/recipes/katana.recipe.json @@ -0,0 +1,36 @@ +{ + "format_version": "1.20.51", + "minecraft:recipe_shaped": { + "description": { + "identifier": "naruto:katana" + }, + "tags": [ + "crafting_table" + ], + "pattern": [ + " #A", + "#A#", + "B# " + ], + "key": { + "#": { + "item": "minecraft:iron_nugget" + }, + "A": { + "item": "minecraft:iron_ingot" + }, + "B": { + "item": "minecraft:stick" + } + }, + "unlock": [ + { + "item": "minecraft:air" + } + ], + "result": { + "item": "naruto:katana", + "count": 1 + } + } + } \ No newline at end of file diff --git a/nBehavior/recipes/ramen.json b/nBehavior/recipes/ramen.json index a5f15f6..1b9a346 100644 --- a/nBehavior/recipes/ramen.json +++ b/nBehavior/recipes/ramen.json @@ -1,31 +1,35 @@ { - "format_version": "1.20.0", - "minecraft:recipe_shaped": { - "description": { + "format_version": "1.20.51", + "minecraft:recipe_shaped": { + "description": { "identifier": "naruto:ramen" + }, + "tags": [ + "crafting_table" + ], + "pattern": [ + "WWW", + "GMG", + " G " + ], + "key": { + "W": { + "item": "minecraft:wheat" }, - - - "tags": [ "crafting_table" ], - "pattern": [ - "WWW", - "GMG", - " G " - ], - "key": { - "W": { - "item": "minecraft:wheat" - }, - "G": { - "item": "minecraft:glass" - }, - "M":{ - "item":"minecraft:cooked_beef" - } + "G": { + "item": "minecraft:glass" }, - "result": { - "item": "naruto:ramen" + "M": { + "item": "minecraft:cooked_beef" } + }, + "unlock": [ + { + "item": "minecraft:cooked_beef" + } + ], + "result": { + "item": "naruto:ramen" } } - +} \ No newline at end of file diff --git a/nBehavior/recipes/shuriken.json b/nBehavior/recipes/shuriken.json index adb88c4..7ec4193 100644 --- a/nBehavior/recipes/shuriken.json +++ b/nBehavior/recipes/shuriken.json @@ -1,5 +1,5 @@ { - "format_version": "1.20.0", + "format_version": "1.20.51", "minecraft:recipe_shaped": { "description": { "identifier": "naruto:shuriken" @@ -17,6 +17,11 @@ "item":"minecraft:iron_nugget" } }, + "unlock": [ + { + "item": "minecraft:air" + } + ], "result": { "item": "naruto:shuriken" } diff --git a/nBehavior/scripts/chakra/chakraAPI.js b/nBehavior/scripts/chakra/chakraAPI.js new file mode 100644 index 0000000..f0f7078 --- /dev/null +++ b/nBehavior/scripts/chakra/chakraAPI.js @@ -0,0 +1,62 @@ +import { world, system } from "@minecraft/server"; + +const ChakraAPI = { + initializePlayerChakra(player, initialChakra = 100) { + const objective = world.scoreboard.getObjective("chakra"); + if (!objective) { + world.scoreboard.addObjective("chakra", "dummy", "Chakra"); + } + player.runCommand(`scoreboard players set @s chakra ${initialChakra}`); + this.updateChakraVisual(player); + console.log(`Initialized chakra for ${player.name}`); + }, + + getPlayerChakra(player) { + const objective = world.scoreboard.getObjective("chakra"); + if (objective) { + return objective.getScore(player.scoreboard); + } + return 0; + }, + + setPlayerChakra(player, amount) { + const objective = world.scoreboard.getObjective("chakra"); + if (objective) { + player.runCommand(`scoreboard players set @s chakra ${amount}`); + this.updateChakraVisual(player); + console.log(`Set chakra for ${player.name} to ${amount}`); + } + }, + + addChakra(player, amount) { + const currentChakra = this.getPlayerChakra(player); + this.setPlayerChakra(player, currentChakra + amount); + }, + + drainChakra(player, amount) { + const currentChakra = this.getPlayerChakra(player); + if (currentChakra >= amount) { + this.setPlayerChakra(player, currentChakra - amount); + return true; + } else { + player.runCommand(`tellraw @s {"rawtext":[{"text":"Not enough chakra!"}]}`); + console.log(`Not enough chakra for ${player.name}`); + return false; + } + }, + + updateChakraVisual(player) { + const currentChakra = this.getPlayerChakra(player); + player.runCommand(`title @s actionbar {"rawtext":[{"text":"Chakra: ${currentChakra}"}]}`); + console.log(`Updated chakra visual for ${player.name} to ${currentChakra}`); + } +}; + +world.afterEvents.playerSpawn.subscribe(event => { + const player = event.player; + system.run(() => { + ChakraAPI.initializePlayerChakra(player); + }); +}); + +export { ChakraAPI }; diff --git a/nBehavior/scripts/chakra/chakraVisuals.js b/nBehavior/scripts/chakra/chakraVisuals.js new file mode 100644 index 0000000..31e6571 --- /dev/null +++ b/nBehavior/scripts/chakra/chakraVisuals.js @@ -0,0 +1,14 @@ +import { system, world } from "@minecraft/server"; +import { ChakraAPI } from "./chakraAPI.js"; + +const updateInterval = 20; // Update every second (20 ticks) + +function updateChakraVisuals() { + for (const player of world.getPlayers()) { + ChakraAPI.updateChakraVisual(player); + } + system.runTimeout(updateChakraVisuals, updateInterval); +} + +// Start the visual update loop +system.runTimeout(updateChakraVisuals, updateInterval); diff --git a/nBehavior/scripts/chakra/jutsuHandler.js b/nBehavior/scripts/chakra/jutsuHandler.js new file mode 100644 index 0000000..9afe7c0 --- /dev/null +++ b/nBehavior/scripts/chakra/jutsuHandler.js @@ -0,0 +1,27 @@ +import { world } from "@minecraft/server"; +import { ChakraAPI } from "./chakraAPI.js"; + +// Jutsu handler +const JutsuHandler = { + handleItemUse(event) { + const player = event.source; + const item = event.item; + + switch (item.id) { + case "naruto:fireball_jutsu": + this.useFireballJutsu(player); + break; + // Add more jutsus here + } + }, + + useFireballJutsu(player) { + if (ChakraAPI.drainChakra(player, 20)) { + player.runCommand(`execute as @s run summon naruto:fireball ~ ~1 ~`); + } + } +}; + +world.events.afterItemUse.subscribe(event => JutsuHandler.handleItemUse(event)); + +export { JutsuHandler }; diff --git a/nBehavior/scripts/main.js b/nBehavior/scripts/main.js index 865a4b8..cb76b80 100644 --- a/nBehavior/scripts/main.js +++ b/nBehavior/scripts/main.js @@ -1,5 +1,8 @@ //js files -import "./serverSide/server.say" +import "./server.say" +//chakra +import { ChakraAPI } from "./chakra/chakraAPI.js"; +import { JutsuHandler } from "./chakra/jutsuHandler.js"; +import "./chakra/chakraVisuals.js"; -//module for the motd(aka the thank you message) - import { ingMessage } from './serverSide/server.say'; \ No newline at end of file +ChakraAPI.initialize(); \ No newline at end of file diff --git a/nBehavior/scripts/server.say.js b/nBehavior/scripts/server.say.js new file mode 100644 index 0000000..7e5311f --- /dev/null +++ b/nBehavior/scripts/server.say.js @@ -0,0 +1,13 @@ +import { world } from "@minecraft/server"; + +export let ingMessage = "§lThanks For Downloading §2Minecraft Bedrock §eNaruto Mod"; + +// Function to send the message to a player +function sendMessageToPlayer(player) { + player.sendMessage(ingMessage); +} + +// Listen for the playerSpawn event +world.afterEvents.playerSpawn.subscribe((event) => { + sendMessageToPlayer(event.player); +}); diff --git a/nBehavior.mcaddon b/nResource.mcaddon similarity index 83% rename from nBehavior.mcaddon rename to nResource.mcaddon index 5e4306c..bc37c1b 100644 Binary files a/nBehavior.mcaddon and b/nResource.mcaddon differ diff --git a/nResource/animations/fire_ball_jutsu.animation.json b/nResource/animations/fire_ball_jutsu.animation.json index 3d400b7..66b59dc 100644 --- a/nResource/animations/fire_ball_jutsu.animation.json +++ b/nResource/animations/fire_ball_jutsu.animation.json @@ -1,5 +1,5 @@ { - "format_version": "1.8.0", + "format_version": "1.10.0", "animations": { "animation.fireball_jutsu": { "loop": true, diff --git a/nResource/attachables/konohaheadband.attachable.json b/nResource/attachables/konohaheadband.attachable.json new file mode 100644 index 0000000..3cee848 --- /dev/null +++ b/nResource/attachables/konohaheadband.attachable.json @@ -0,0 +1,20 @@ +{ + "format_version": "1.10.0", + "minecraft:attachable": { + "description": { + "identifier": "naruto:konoha_headband", + "render_controllers": ["controller.render.armor"], + "materials": { + "default": "entity_alphatest", + "enchanted": "entity_alphatest_glint" + }, + "textures": { + "default": "textures/entity/attachable/konoha_headband", + "enchanted": "textures/misc/enchanted_item_glint" + }, + "geometry": { + "default": "geometry.konoha_headband" + } + } + } +} \ No newline at end of file diff --git a/nResource/entity/weapons/kunai.json b/nResource/entity/weapons/kunai.json index e2ff560..8fb8b24 100644 --- a/nResource/entity/weapons/kunai.json +++ b/nResource/entity/weapons/kunai.json @@ -1,5 +1,5 @@ { - "format_version": "1.20.0", + "format_version": "1.20.51", "minecraft:client_entity": { "description": { "identifier": "naruto:kunai", @@ -7,10 +7,10 @@ "default": "snowball" }, "textures": { - "default": "textures/items/weapons/kunai" + "default": "textures/models/weapons/kunai" }, "geometry": { - "default": "geometry.item_sprite" + "default": "geometry.kunai" }, "render_controllers": [ "controller.render.item_sprite" ], "animations": { diff --git a/nResource/entity/weapons/shuriken.entity.json b/nResource/entity/weapons/shuriken.entity.json index 6251969..bf6ab90 100644 --- a/nResource/entity/weapons/shuriken.entity.json +++ b/nResource/entity/weapons/shuriken.entity.json @@ -1,5 +1,5 @@ { - "format_version": "1.20.0", + "format_version": "1.20.51", "minecraft:client_entity": { "description": { "identifier": "naruto:shuriken", diff --git a/nResource/models/entity/headbands/konahaheadband.geo.json b/nResource/models/entity/headbands/konahaheadband.geo.json new file mode 100644 index 0000000..d93ee6c --- /dev/null +++ b/nResource/models/entity/headbands/konahaheadband.geo.json @@ -0,0 +1,35 @@ +{ + "format_version": "1.19.0", + "minecraft:geometry": [ + { + "description": { + "identifier": "geometry.konoha_headband", + "texture_width": 32, + "texture_height": 32, + "visible_bounds_width": 2, + "visible_bounds_height": 2.5, + "visible_bounds_offset": [0, 0.75, 0] + }, + "bones": [ + { + "name": "root_item", + "pivot": [0, 0, 0] + }, + { + "name": "helmet", + "parent": "root_item", + "pivot": [0, 0, 0], + "binding": "'head'", + "cubes": [ + { + "origin": [-4, 0, -4], + "size": [8, 8, 8], + "inflate": 1, + "uv": [0, 0] + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/nResource/models/entity/weapons/kunai.geo.json b/nResource/models/entity/weapons/kunai.geo.json new file mode 100644 index 0000000..e9bd368 --- /dev/null +++ b/nResource/models/entity/weapons/kunai.geo.json @@ -0,0 +1,27 @@ +{ + "format_version": "1.12.0", + "minecraft:geometry": [ + { + "description": { + "identifier": "geometry.kunai", + "texture_width": 32, + "texture_height": 32, + "visible_bounds_width": 2, + "visible_bounds_height": 1.5, + "visible_bounds_offset": [0, 0.25, 0] + }, + "bones": [ + { + "name": "bb_main", + "pivot": [0, 0, 0], + "cubes": [ + {"origin": [-1, 1, -2], "size": [1, 1, 5], "uv": [0, 0]}, + {"origin": [-1, -3, -10], "size": [0, 8, 8], "pivot": [-1, 1.5, -6], "rotation": [0, 0, -90], "uv": [0, 8]}, + {"origin": [-0.5, -2, -10], "size": [0, 8, 8], "uv": [0, 0]}, + {"origin": [-0.5, 0.5, 3], "size": [0, 2, 2], "uv": [0, 0]} + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/nResource/render_controllers/item_sprite.render_controller.json b/nResource/render_controllers/item_sprite.render_controller.json new file mode 100644 index 0000000..7af284e --- /dev/null +++ b/nResource/render_controllers/item_sprite.render_controller.json @@ -0,0 +1,17 @@ +{ + "format_version": "1.10.0", + "render_controllers": { + "controller.render.item_sprite": { + "geometry": "geometry.default", + "materials": [ + { + "mat": "material.default" + } + ], + "textures": [ + "texture.default" + ] + } + } + } + \ No newline at end of file diff --git a/nResource/textures/items/katana.png b/nResource/textures/items/katana.png deleted file mode 100644 index 58dacb8..0000000 Binary files a/nResource/textures/items/katana.png and /dev/null differ diff --git a/nResource/textures/items/weapons/12.png b/nResource/textures/items/weapons/12.png new file mode 100644 index 0000000..9085261 Binary files /dev/null and b/nResource/textures/items/weapons/12.png differ diff --git a/nResource/textures/items/weapons/image.png b/nResource/textures/items/weapons/image.png new file mode 100644 index 0000000..89c1bdc Binary files /dev/null and b/nResource/textures/items/weapons/image.png differ diff --git a/nResource/textures/items/weapons/katana.xcf b/nResource/textures/items/weapons/katana+/katana.xcf similarity index 100% rename from nResource/textures/items/weapons/katana.xcf rename to nResource/textures/items/weapons/katana+/katana.xcf diff --git a/nResource/textures/items/weapons/katanaog.png b/nResource/textures/items/weapons/katana+/katanaog.png similarity index 100% rename from nResource/textures/items/weapons/katanaog.png rename to nResource/textures/items/weapons/katana+/katanaog.png diff --git a/nResource/textures/models/weapons/kunai.png b/nResource/textures/models/weapons/kunai.png new file mode 100644 index 0000000..b53bbde Binary files /dev/null and b/nResource/textures/models/weapons/kunai.png differ