Skip to main content

addon list

this is list of my active addon currenly # SHome SlimyPiston NameTagRename IRestocker TPR BeaconAutoBuild

post

Rewrite SHome again

rewrite the code again # i want to make it easy for me to add new stuff, and its the 5th time i rewrite the whole code. i keep forgetting what i code and how i do it, and then thare is that script v2 thing and custom command, so i just make thing up to patch it and the code is a mess(for me) because of it. now i want to code it so that its eazy to fix and update.

mcbe 1.21.70 break most beta script

so yeah, lots of stuff that use beta api is broken. so it might need some time to fix it. script api is updated to v2 beta # after this update most script that use beta api is broken, but, the one on stable v1 is fine, so no need to change it. well it might take some time for me to fix it

discord server (wip)

still in progress actualy, but its good to go. # the discord server is: https://discord.gg/SmzWxC2KUm

tp addon dev

·
my plans player damage cancel system make my own command handle easier rework the addon combine all addon optimize it

project

day night tuner

how it work # it chenga the time it need to finish 1 cycle of day or night for example: if you set the day to 20 minute, a full day night cycle will be 30 minute, couse by default day and night is 10 minute each so 20 per cycle (it still in progres)

Custom Command

how to use # go to my github repo here and see its page, or use this link for the wiki page. this use minecraft’s own api CustomCommandRegistry for custom command it make the making of custom command easyer to read and understand (thats what i hope) DZombies45/MCBE-CustomCommand Custom Command for Minecraft Bedrock

mcbe signal system

using scriptEvent to call and listen other addon like an api # import { ScriptEventSource, system } from "@minecraft/server"; // initial variable const namespace = "dz"; const signalId = `${namespace}:signal`; // aignal list const requestPending = new Map(); const responseWith = new Map(); // class for signal export const SIGNAL = { emitAndListen: (signal, isi) => { return new Promise((resolve) => { const requestId = Math.random().toString(36).substring(2); requestPending.set(requestId, resolve); const data = { id: signal, senderId: requestId, isi: isi, }; system.sendScriptEvent(signalId, JSON.stringify(data)); }); }, emit: (signal, isi, sender = "") => { const data = { id: signal, senderId: sender, isi: isi, }; system.sendScriptEvent(signalId, JSON.stringify(data)); }, connect: (id, callback = cb) => { responseWith.set(id, callback); }, disconnect: (id) => { responseWith.delete(id); }, }; // default callback (cb = callback?) const cb = (data) => { console.warn( `signal rechived id: ${data.id},${data.senderId === "" ? "" : ` and sender: ${data.senderId}`} that contains: ${data.isi}`, ); }; // listen for a signal system.afterEvents.scriptEventReceive.subscribe( (eventData) => { try { const { id, message, sourceType } = eventData; if (id !== "" || sourceType !== ScriptEventSource.Server) return; const data = JSON.parse(message); const callback = responseWith.has(data.id) ? responseWith.get(data.id) : requestPending.get(data.id); if (callback) return; callback(data); if (requestPending.has(data.id)) requestPending.delete(data.id); } catch (e) { console.error(`[dz-signal] error: ${e}`); } }, { namespaces: [namespace] }, ); usage example: # to initiate # const signal = new SIGNAL(); listen to signal # // listen to tp player signal.connect("tp", cb); function cb(data) { const { senderId, isi } = JSON.parse(d); console.log(`rechived data: ${isi}, from: ${senderId}`); } emit a signal # signal.emit("tp", "0 0 0", "me"); and thats it what i use the most (well in like 2 addon that I already make public download) #

inv restock update plans

what to do # so i here is what i want to add when i update this addon, so unless i add 1 of this thisng, i won’t upload the update event if the new version is up, ill do this first. item durability limit new setting ui using action bar/title easy custom sort system inv sort function auto add from sellected chest auto sort to/from chest better item(enchant) filter make sort template ui for sort action form why do i use action event # so basicly no easy way to detect inventory is open or close at the moment, so i need to use every action player can use.

noteblock note setter

working on it # it’s an addon that will make changing noteblock note easy with ui (fornow) so it seems making it its own block will be hard, so will need to wait till we can check restone update on custom block like its posible with tick interval, but when i test it, it will lag after some block is placed on low end device, so ill wait till then

silky spawner script

·
silk spawner code # just copy this code, and paste it on your behavior pack script. or just download the addon here on mcpedl // import minecraft api import { world, system } from "@minecraft/server"; // addon version const version = "1.0"; // item use to destroy the spawner const pickaxe = [ "minecraft:iron_pickaxe", "minecraft:golden_pickaxe", "minecraft:diamond_pickaxe", "minecraft:netherite_pickaxe", ]; // on block break world.beforeEvents.playerBreakBlock.subscribe( (data) => { // extrack data const { block, player, itemStack } = data; // verify if hold item match pickaxe list above and has silk touch enchantment if (!itemStack || !pickaxe.includes(itemStack.typeId)) return; if ( !itemStack .getComponent("minecraft:enchantable") ?.getEnchantment("silk_touch") ) return; data.cancel = true; // what to do after const spawnPos = centerBlockToEntity(block.location); const item = block.getItemStack(1, true); // spawn the item and add feedback, on the next active tick, couse beforeEvents run on idle tick or read only system.run(() => { pickDurability(player); block.setType("minecraft:air"); block.dimension.spawnItem(item, spawnPos); player.playSound("block.mob_spawner.break", { pitch: randomRange(0.8, 1.2), location: block.location, volume: 1, }); }); }, { blockTypes: ["minecraft:mob_spawner"], }, ); // convert block position to entity location function centerBlockToEntity(pos) { return { x: pos.x + 0.5, y: pos.y + 0.5, z: pos.z + 0.5, }; } // remove durability from pickaxe function pickDurability(player) { const inv = player.getComponent("inventory").container; const item = inv.getItem(player.selectedSlotIndex); if (!item) return true; const durability = item.getComponent("minecraft:durability"); const unbreakingLv = item.getComponent("minecraft:enchantable")?.getEnchantment("unbreaking") ?.level || 0; const breakChance = durability.getDamageChance(unbreakingLv); if (Math.random() * 100 <= breakChance) durability.damage += 1; if (durability.damage >= durability.maxDurability) { inv.setItem(player.selectedSlotIndex, undefined); player.playSound("random.break", { pitch: randomRange(0.8, 1.2), location: player.location, volume: 1, }); return true; } inv.setItem(player.selectedSlotIndex, item); return false; } // just random function function randomRange(min = 0, max = 1) { return Math.random() * (max - min) + min; } // just to check if addon work or not world.afterEvents.playerSpawn.subscribe((data) => { if (!data.initialSpawn) return; data.player.sendMessage({ rawtext: [ { text: `§2+ §asilky spawn v${version} is installed`, }, ], }); });

Recent

day night tuner

how it work # it chenga the time it need to finish 1 cycle of day or night for example: if you set the day to 20 minute, a full day night cycle will be 30 minute, couse by default day and night is 10 minute each so 20 per cycle (it still in progres)

Custom Command

how to use # go to my github repo here and see its page, or use this link for the wiki page. this use minecraft’s own api CustomCommandRegistry for custom command it make the making of custom command easyer to read and understand (thats what i hope) DZombies45/MCBE-CustomCommand Custom Command for Minecraft Bedrock

mcbe signal system

using scriptEvent to call and listen other addon like an api # import { ScriptEventSource, system } from "@minecraft/server"; // initial variable const namespace = "dz"; const signalId = `${namespace}:signal`; // aignal list const requestPending = new Map(); const responseWith = new Map(); // class for signal export const SIGNAL = { emitAndListen: (signal, isi) => { return new Promise((resolve) => { const requestId = Math.random().toString(36).substring(2); requestPending.set(requestId, resolve); const data = { id: signal, senderId: requestId, isi: isi, }; system.sendScriptEvent(signalId, JSON.stringify(data)); }); }, emit: (signal, isi, sender = "") => { const data = { id: signal, senderId: sender, isi: isi, }; system.sendScriptEvent(signalId, JSON.stringify(data)); }, connect: (id, callback = cb) => { responseWith.set(id, callback); }, disconnect: (id) => { responseWith.delete(id); }, }; // default callback (cb = callback?) const cb = (data) => { console.warn( `signal rechived id: ${data.id},${data.senderId === "" ? "" : ` and sender: ${data.senderId}`} that contains: ${data.isi}`, ); }; // listen for a signal system.afterEvents.scriptEventReceive.subscribe( (eventData) => { try { const { id, message, sourceType } = eventData; if (id !== "" || sourceType !== ScriptEventSource.Server) return; const data = JSON.parse(message); const callback = responseWith.has(data.id) ? responseWith.get(data.id) : requestPending.get(data.id); if (callback) return; callback(data); if (requestPending.has(data.id)) requestPending.delete(data.id); } catch (e) { console.error(`[dz-signal] error: ${e}`); } }, { namespaces: [namespace] }, ); usage example: # to initiate # const signal = new SIGNAL(); listen to signal # // listen to tp player signal.connect("tp", cb); function cb(data) { const { senderId, isi } = JSON.parse(d); console.log(`rechived data: ${isi}, from: ${senderId}`); } emit a signal # signal.emit("tp", "0 0 0", "me"); and thats it what i use the most (well in like 2 addon that I already make public download) #

inv restock update plans

what to do # so i here is what i want to add when i update this addon, so unless i add 1 of this thisng, i won’t upload the update event if the new version is up, ill do this first. item durability limit new setting ui using action bar/title easy custom sort system inv sort function auto add from sellected chest auto sort to/from chest better item(enchant) filter make sort template ui for sort action form why do i use action event # so basicly no easy way to detect inventory is open or close at the moment, so i need to use every action player can use.

noteblock note setter

working on it # it’s an addon that will make changing noteblock note easy with ui (fornow) so it seems making it its own block will be hard, so will need to wait till we can check restone update on custom block like its posible with tick interval, but when i test it, it will lag after some block is placed on low end device, so ill wait till then

silky spawner script

·
silk spawner code # just copy this code, and paste it on your behavior pack script. or just download the addon here on mcpedl // import minecraft api import { world, system } from "@minecraft/server"; // addon version const version = "1.0"; // item use to destroy the spawner const pickaxe = [ "minecraft:iron_pickaxe", "minecraft:golden_pickaxe", "minecraft:diamond_pickaxe", "minecraft:netherite_pickaxe", ]; // on block break world.beforeEvents.playerBreakBlock.subscribe( (data) => { // extrack data const { block, player, itemStack } = data; // verify if hold item match pickaxe list above and has silk touch enchantment if (!itemStack || !pickaxe.includes(itemStack.typeId)) return; if ( !itemStack .getComponent("minecraft:enchantable") ?.getEnchantment("silk_touch") ) return; data.cancel = true; // what to do after const spawnPos = centerBlockToEntity(block.location); const item = block.getItemStack(1, true); // spawn the item and add feedback, on the next active tick, couse beforeEvents run on idle tick or read only system.run(() => { pickDurability(player); block.setType("minecraft:air"); block.dimension.spawnItem(item, spawnPos); player.playSound("block.mob_spawner.break", { pitch: randomRange(0.8, 1.2), location: block.location, volume: 1, }); }); }, { blockTypes: ["minecraft:mob_spawner"], }, ); // convert block position to entity location function centerBlockToEntity(pos) { return { x: pos.x + 0.5, y: pos.y + 0.5, z: pos.z + 0.5, }; } // remove durability from pickaxe function pickDurability(player) { const inv = player.getComponent("inventory").container; const item = inv.getItem(player.selectedSlotIndex); if (!item) return true; const durability = item.getComponent("minecraft:durability"); const unbreakingLv = item.getComponent("minecraft:enchantable")?.getEnchantment("unbreaking") ?.level || 0; const breakChance = durability.getDamageChance(unbreakingLv); if (Math.random() * 100 <= breakChance) durability.damage += 1; if (durability.damage >= durability.maxDurability) { inv.setItem(player.selectedSlotIndex, undefined); player.playSound("random.break", { pitch: randomRange(0.8, 1.2), location: player.location, volume: 1, }); return true; } inv.setItem(player.selectedSlotIndex, item); return false; } // just random function function randomRange(min = 0, max = 1) { return Math.random() * (max - min) + min; } // just to check if addon work or not world.afterEvents.playerSpawn.subscribe((data) => { if (!data.initialSpawn) return; data.player.sendMessage({ rawtext: [ { text: `§2+ §asilky spawn v${version} is installed`, }, ], }); });