Skip to content

Commit

Permalink
Merge pull request #32 from ModMaker101/development
Browse files Browse the repository at this point in the history
updating some stuff and adding sneak and 3d unfinished kunai
  • Loading branch information
ModMaker101 authored Jul 14, 2024
2 parents 214d905 + 3e965fb commit b3f94b4
Show file tree
Hide file tree
Showing 27 changed files with 313 additions and 46 deletions.
11 changes: 5 additions & 6 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion nBehavior/entities/jutsu/fireball_jutsu.entity.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "1.20.0",
"format_version": "1.20.52",
"minecraft:entity": {
"description": {
"identifier": "naruto:fireball_jutsu",
Expand Down
2 changes: 1 addition & 1 deletion nBehavior/entities/weapons/shuriken.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "1.20.0",
"format_version": "1.20.51",
"minecraft:entity": {
"description": {
"identifier": "naruto:shuriken",
Expand Down
13 changes: 9 additions & 4 deletions nBehavior/items/weapons/katana.item.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "1.20.0",
"format_version": "1.20.51",
"minecraft:item": {
"description": {
"identifier": "naruto:katana",
Expand All @@ -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": {
Expand All @@ -22,7 +25,9 @@
"minecraft:repairable": {
"repair_items": [
{
"items": ["iron_ingot"],
"items": [
"iron_ingot"
],
"repair_amount": 62
}
]
Expand Down
2 changes: 1 addition & 1 deletion nBehavior/items/weapons/shuriken.item.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "1.20.0",
"format_version": "1.20.51",
"minecraft:item": {
"description": {
"category": "equipment",
Expand Down
36 changes: 36 additions & 0 deletions nBehavior/recipes/katana.recipe.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
52 changes: 28 additions & 24 deletions nBehavior/recipes/ramen.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
7 changes: 6 additions & 1 deletion nBehavior/recipes/shuriken.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "1.20.0",
"format_version": "1.20.51",
"minecraft:recipe_shaped": {
"description": {
"identifier": "naruto:shuriken"
Expand All @@ -17,6 +17,11 @@
"item":"minecraft:iron_nugget"
}
},
"unlock": [
{
"item": "minecraft:air"
}
],
"result": {
"item": "naruto:shuriken"
}
Expand Down
62 changes: 62 additions & 0 deletions nBehavior/scripts/chakra/chakraAPI.js
Original file line number Diff line number Diff line change
@@ -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 };
14 changes: 14 additions & 0 deletions nBehavior/scripts/chakra/chakraVisuals.js
Original file line number Diff line number Diff line change
@@ -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);
27 changes: 27 additions & 0 deletions nBehavior/scripts/chakra/jutsuHandler.js
Original file line number Diff line number Diff line change
@@ -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 };
9 changes: 6 additions & 3 deletions nBehavior/scripts/main.js
Original file line number Diff line number Diff line change
@@ -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';
ChakraAPI.initialize();
13 changes: 13 additions & 0 deletions nBehavior/scripts/server.say.js
Original file line number Diff line number Diff line change
@@ -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);
});
Binary file renamed nBehavior.mcaddon → nResource.mcaddon
Binary file not shown.
2 changes: 1 addition & 1 deletion nResource/animations/fire_ball_jutsu.animation.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "1.8.0",
"format_version": "1.10.0",
"animations": {
"animation.fireball_jutsu": {
"loop": true,
Expand Down
20 changes: 20 additions & 0 deletions nResource/attachables/konohaheadband.attachable.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
6 changes: 3 additions & 3 deletions nResource/entity/weapons/kunai.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"format_version": "1.20.0",
"format_version": "1.20.51",
"minecraft:client_entity": {
"description": {
"identifier": "naruto:kunai",
"materials": {
"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": {
Expand Down
2 changes: 1 addition & 1 deletion nResource/entity/weapons/shuriken.entity.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"format_version": "1.20.0",
"format_version": "1.20.51",
"minecraft:client_entity": {
"description": {
"identifier": "naruto:shuriken",
Expand Down
Loading

0 comments on commit b3f94b4

Please sign in to comment.