// Give the item on player join (optional) world.afterEvents.playerJoin.subscribe(({ player }) => { const inventory = player.getComponent("inventory").container;
// Effect properties const SPEED_AMPLIFIER = 2; const JUMP_AMPLIFIER = 2; const DURATION_SECONDS = 15; Addon- Rabocaa levaa ruka -1.21 -
This addon adds a (Rabocaa Levaa Ruka) that, when used, gives the player a temporary speed & jump boost with a special effect. ๐ฆ File Structure Rabocaa_Levaa_Ruka_1.21/ โโโ behavior_pack/ โ โโโ manifest.json โ โโโ pack_icon.png โ โโโ scripts/ โ โโโ main.js โโโ resource_pack/ โ โโโ manifest.json โ โโโ pack_icon.png โ โโโ textures/ โ โโโ rabocaa_levaa_ruka.png โโโ README.txt โ๏ธ Behavior Pack Manifest ( behavior_pack/manifest.json ) { "format_version": 2, "header": { "name": "Rabocaa Levaa Ruka - BP", "description": "Adds the Rabocaa Levaa Ruka item with special abilities.", "uuid": "a7f5e3d2-1b4c-4e8a-9f2b-6d3c7e1a5b9f", "version": [1, 0, 0], "min_engine_version": [1, 21, 0] }, "modules": [ { "type": "script", "language": "javascript", "uuid": "b8c4d3e2-5f6a-4b7c-9d1e-2a3b4c5d6e7f", "entry": "scripts/main.js", "version": [1, 0, 0] } ], "dependencies": [ { "module_name": "@minecraft/server", "version": "1.12.0" }, { "module_name": "@minecraft/server-ui", "version": "1.3.0" } ], "capabilities": ["script_eval"] } ๐ Script ( behavior_pack/scripts/main.js ) import { world, system, ItemStack } from "@minecraft/server"; // Item ID (custom, but using a vanilla head as base for simplicity) const ITEM_ID = "minecraft:skull 5"; // Using skeleton skull as base (you can replace with custom item later) const CUSTOM_ITEM_NAME = "Rabocaa Levaa Ruka"; // Give the item on player join (optional) world
source.addEffect("jump_boost", DURATION_SECONDS * 20, { amplifier: JUMP_AMPLIFIER, showParticles: true }); const JUMP_AMPLIFIER = 2
// Optional: Give a temporary glowing effect source.addEffect("glowing", DURATION_SECONDS * 20, { amplifier: 0, showParticles: false });
source.sendMessage("ยง5โจ You feel the power of Rabocaa Levaa Ruka! โจ");
if (currentItem && currentItem.amount > 1) { currentItem.amount -= 1; inventory.setItem(selectedSlot, currentItem); } else { inventory.setItem(selectedSlot, undefined); } } });