#Script API General
1 messages · Page 121 of 1
The damage stat went to mybboats head now its killing everything
Here goes take 50076
Uh oh all that logic fails cause its removed before projectile hits me so it cant apply damage
Im back to square 1 and im at a complete loss
Ima see if i cab string a before entity removed event to it
how would one place a block in an unloaded chunk
You have to load it.
dang
Will the components still exist in an entity before removal event im running out of options
I need help i tried 3 different ways not 1 way has worked
I tried projectile hit entity wont get the entity i tried adding the entities dp to the arrow but arrow disapears to fast so it just throws errors
I tried before entity removal and nothing
Ok so minecraft hurt with case projectile can get both i may be on to something
Omg omg ong omg omg its actually hurting me im so happy
Its a terrible shot skeleton tho
How does it miss 2 inc away thats not even my script thats vanilla
I need a stronger skelly for tests i think
Ive never been this happy to die but seriously skelly git gud
How do I make it so when you press a button on a gui it opens another gui
Make the gui u wanna show a function then execute that function when the button is clicked
//Button was clicked:
otherGui(player)
is there a way to get the map color of a block?
yes
found it
why is block.getComponent('minecraft:map_color') returning undefined?
i am on stable 2.3.0
is it a vanilla block?
hey @wary edge sorry for the ping but im looking into the adk library for a custom stairs template and the custom component is there but I don't find the JSON block, would you mind sending it to me or telling me where it is because I dont find it in the repo 🙏
it was wildflowers, it turns out not all vanilla blocks have the map color component
Bc its block.getMapColor()
both are valid
Really? Never knew there was a component for it
yeah, getMapColor is in beta though
I just knew about the map color thing when this method was released
and btw the map color component class has properties for more than just color
Let me search for it
I see
perhaps this only works for custom blocks, and the getMapColor() method works for all blocks
for now
Idk
yeah ^
can dynamic properties be set in read-only mode?
No
You can use a system.run to get out of read-only mode (assuming you are using a beforeEvent)
i dont think you can make dynamic properties read only?
well you can just not write on it tho
what does
initialRotation?: number;
in spawnEntity expect? x rotation?
I was planning on using it to log players leaving the world, so rip that idea I guess
I asked before and they said it was y rotation
thx
they are NOT the same
You can wait one tick before logging it in DP
Won't they be invalid by that time?
Save their name outside of system.run
yes, iirc
I tested it again, and yes, you can
Hi sorry for ping i know this is a bit late but what does param mean?
Parameter
I said valid, not same. I even explained how they were different.
Valid
the component doesn't always exist
I know.
by valid, I mean valid in the api
this is a beta API thing, also color map component is more powerful
it seems this this has already been discussed in the following messages
yeah
There is 1 thing i wish bridge could do is find and replace all references when i change a function name
Even vs code struggles with that
I think visual studio was the only ide i used that could actually reliably get all references
I chose bad nsming for my scoreboard function
just use the find and replace function.
press ctrl+f
press this
Isnt ctrl f file specific
okay so use the other find and replace
Also thats not truly reliable if naming of some local vars or tags also match
About minimap, do they use get map color to make it
yes
Alright thankyou
thats on you then
See if you have a var that matches funct name find and replace changes that to i said the function namevwas a bad chouce
if you are unsure about a function name, keep that in mind so its easier to replace.
And im not saying i did do that but questSetter was to generic snd considering it can hsndle sll scoreboad logic it wasnt a smart choice
okay
You can also do something called Rename Symbol in VS Code.
This one renames only the symbol (which can be a function) that you have selected. It doesn't change stuff that has the same name, but not the same purpose:
Random: is it also more efficient to display map item renderer just like compass/clock render on other packs to display minimap. Or does it need to be help and adjust how it's displayed on animation controllers
thats awesome
man I need to move to vscode
Visual studio has a rename all references which is awesome
I dont think minecraft addons can be coded in visual studio tho
uh
what
Visual studio is not vs code
I got them confused before to
Theres just not a minecraft plug in like there is for vs code
Atleast i didnt find 1
but yeah I got confused
Tbh even vs code is having issues with reliably knowing what is or isnt alliwed if i throw any of my addons in vs code it says its riddled in errors cause it doesnt know wtf is going on
he didnt say vs though, he said vs code
.
im wondering why you mentioned vs
Oh i was saying that vs had something better i was going off that
It looked like the conversation mentioned it.
This was just pointingbout that vs has a more reliable way just notvsuited for minecraft
Do you use the npm packages by minecraft? They're what I use to make my add-ons in VS Code.
i thought you misunderstood aevarkan or something, nvm
Im talking vs not vs code vs doesnt have that
Vs isnt intended for simply editing files or mods ect sure it can be used to
I know the fact they are named the same is so messed up
Vs abd vs code similar naming
Not even close to the same ide
I'm assuming you mean Visual Studio by "vs"? The one with a purple icon?
Yes
why not just say vsc
Thats even closer in naming
Vs vsc not its 1 letter dif not 1 word dif
better to read imo
Vs has a bright purple icon vsc has a blue icon just so you are aware
I use vs whenever im coding in c#
Hi, you guys know if player tags have characters limit? Like dynamic properties
you could just look it up
30 chars it says, for bedrock
the internet was right, i was the only the messenger
😹
That works for me, thanks
how do i check if the simulated player is at the block? I cant await these method, they dont return a promise..
it basically moves to the block and doesnt do anything else because all 3 of those lines run at the same time
Been curious about something does script allow you to make and import your own json files
Nope, they have to be .js files and be inside your scripts folder
If its for configuration you can just export an object or an array
Is there a way to unload areas that have been previously loaded by a player
no
Why doesn't a parameter type exist for every value
bc I want to use string and a number but its not possible in custom commands
wdym, you can use those.
No you cant there is no CustomCommandParamType.None or so
what
you said string and number
yeah I mean both in a parameter
None was just an example so its like everything number and string
what vanilla command has a parameter like that
Just use a string, you can always check if a param is a number
Ik but its weird to use "100"
You don't have to always wrap it around quotes I think
you need to if you set the parameter to string
if he wants numbers and characters, he needs to.
why do you need this anyway
bc I use Enums some of them use number and some string for example add <number> and protect <on|off>
oh you mean, mixed enum value types
I hope we get sub commands soon
I always cry happy when i make something that is so reusable its not even funny
same! they would open up possibilities for so many different things!
only other thing I'd want other than sub commands very very very badly is data driven UI. (which is in dev, and we got a cool look at it #off-topic message)
basically everything else in the game is at it's peak. you can manipulate alot of things (in the coming versions, we'll have before event of entityHurt with a potential fix for the knockback.)
only a couple things left like maybe having key press/hold/unpress events
being able to copy/paste stuff via script api
entity equipment (most realistic and most needed)
and block dynamic properties maybe? in a controlled way if possible.
maybe even websockets getting into server net, but that's a bit far fetched I believe.
oh yeah an itemChange event for equipment sounds nice too. and realistic even
yeah I saw, thats exciting
I just realized after like 1 and a half years that I've been using float numbers in the amplifiers of applyEffect(), and yet it worked perfectly fine.
It seems to automatically floor the values rather than throw an error, which is weird since it doesn't do that for commands.
There are several places where numbers are implicitly floored. maxDistance in BlockRaycastOptions is another one
I never even knew that was floored this whole time, now I gotta go back and change things lol.
Thanks for the headsup.
I found out the hard way when making a custom third-person camera that was aware of block collisions. I now always take the ceiling of the input I pass in
Things like this should really be specified in the docs, would save a lot of trouble down the line.
I remembered someone told me that but forgot who and when. If there is demand for that I can probably figure out a way to put that info in docs.
Yo im trying to cancel bucket/lava placement in a given region,
world.beforeEvents.playerPlaceBlock.subscribe((ev) => {
if (!ensureGlobalsReady()) return;
const player = ev.player;
const block = ev.block;
if (!player || !block) return;
const claim = ClaimManager.getClaimAtLocation({
location: block.location,
dimension: player.dimension
});
if (!claim) return;
if (!ClaimManager.canPlayerInteract(player, claim)) {
ev.cancel = true;
player.sendMessage("§cYou cannot place blocks in this claim.");
}
});
world.beforeEvents.playerInteractWithBlock.subscribe(ev => {
if (!ensureGlobalsReady()) return;
const player = ev.source;
if (!player || player.typeId !== "minecraft:player") return;
const block = ev.block;
if (!block) return;
const claim = ClaimManager.getClaimAtLocation({
location: block.location,
dimension: player.dimension
});
if (!claim) return;
if (!ClaimManager.canPlayerInteract(player, claim)) {
ev.cancel = true;
player.sendMessage("§cYou cannot use blocks here (claimed land).");
}
});
world.beforeEvents.itemUse.subscribe((ev) => {
if (!ensureGlobalsReady()) return;
const player = ev.source;
if (!player || player.typeId !== "minecraft:player") return;
const block = ev.block;
if (!block) return;
const claim = ClaimManager.getClaimAtLocation({
location: block.location,
dimension: player.dimension
});
if (!claim) return;
if (!ClaimManager.canPlayerInteract(player, claim)) {
ev.cancel = true;
player.sendMessage("§cYou cannot use items here (claimed land).");
}
});
Lava/Water buckets appear to ignore the block for some reason, any advice?
Im ready to bang head on rock now
Wait i dont need to do that cause we have technology now
Im ready to bang head on computer
For testing i had a test to spawn a named entity whenever i use any item
That named entity is set to 5k health
I forgot to take it off
Whoops
is it possible to not run the function dead but only the hit one of the entity has a tag ?
`import {
world,
system,
EntityDamageCause
} from "@minecraft/server";
const bullets = ["minecraft:arrow"];
world.afterEvents.entityDie.subscribe((event) => {
const {
damageSource,
deadEntity
} = event;
const {
cause,
damagingEntity,
damagingProjectile
} = damageSource;
if (cause === EntityDamageCause.projectile && bullets.includes(damagingProjectile?.typeId)) {
damagingEntity?.runCommand("execute as @s run function us_target_destroyed");
}
});
world.afterEvents.projectileHitEntity.subscribe((event) => {
const {
dimension,
hitVector,
location,
projectile,
source
} = event;
const entityHit = event.getEntityHit()?.entity;
if (bullets.includes(projectile?.typeId)) {
source?.runCommand("title @s actionbar Hit");
}
});`
Question in custum commands will vector 3 accept ~ at all or no if it has a valid origin
Why does mojang take so long to fix bugrock?
Ya'll, if I have a script that has similar naming and action to another script, would it conflict or would it run fine?
Like, if I have two separate addons that use the same script that dashes them forward through scriptevent
idk about that, what i know is
if there's 2 separated addon, and then their customCommand input is same, it'll collide (i got this from using Essential + Dynamic Light from Gao)
in 1st addon: "test:command"
2nd addon: "test:command"
it'll choose one
use different namespaces
the first addon added will have the default command (the one without the namespace)
also consider using IPC (inter pack communication)
to make only one register the pack
you can make your own or use [Omniac's](#1277940040688996512 message).
i made one myself that's simpler and more advanced but I've decided to keep it private.
they'd do the action twice
but it really depends on the context
again the solution above is relevant to you too.
they got alot of stuff to do, like scripts, modelling, etc.
they are working as best as they can, be patient. if there's a bug you wanna report, use https://feedback.minecraft.net/hc/en-us/articles/360003463511-Submitting-a-Bug-Report
more context is needed.
try itemUseOn or itemUse + getBlockFromViewDirection or something like it.
reword your question please. or elaborate on what you mean.
Use this to highlight your code for readability:
JavaScript
```js
console.log("Hello from JavaScript");
```
Typescript
```ts
const message: string = "Hello from Typecript";
console.log(message);
```
JavaScript Example:
console.log("Hello from JavaScript");
TypeScript example:
const message: string = "Hello from Typecript";
console.log(message);
Hello guys
I wanna ask question :
So whenever a player enters a server the server crashes
Does that imply there is something wrong with his data file ?
- on log i see something like :
Xuid : his xuid and name , without the pfid
- is it possible to know the player's name using .dat files that are on the world folder
In db folder and level.dat
Players names are encrypted/obfuscated in the level.dat file unfortunately, but there is one workaround. Whenever a player logs in to the world, you can have your script store their name as a dynamic property if the property hasn't been generated for them yet. Then you will be able to know which player is which in the file.
But it crashes the server bro ☠️
Literally when that player connects to the server and i said connect not join , the server crashes after 3 seconds or so
Is there event to check wether the players connects to the server
try the @minecraft/server-net's asyncPlayerJoin event
it's waaaay earlier than @minecraft-server's playerJoin event.
Ok thx
But does it add dynamic proprety to its data ?
Is it possible to add a one
I think the files itself is malformed or something
no
btw PacketId(s) for easier access: https://jaylydev.github.io/scriptapi-docs/latest/enums/_minecraft_server-net.PacketId.html
My problem is how to know what causes the crash when he enter the server
maybe his inventory has alot of data
like these shulker bans
I tried to navigate the world data
if the server isn't that strong, maybe that could cause the crash
But i couldn't know what was his player's data
Bro he is the only account who causes that
the exact crash message
Lemme check
yup, it looks like a data corruption on his player. tho i could be wrong. the crash message will clarify everything to me
[2025-12-18 22:34:05:468 INFO] [Json] minecraft:skeleton | minecraft:behavior.nearest_attackable_target | minecraft:skeleton | For entity skeleton, "attack_interval" is disabled (max <= 0); goal will fall back to "scan_interval" (ticks).
[2025-12-18 22:34:05]
[2025-12-18 22:34:09:841 INFO] [Json] minecraft:zombie | minecraft:behavior.nearest_attackable_target | minecraft:zombie | For entity zombie, "attack_interval" is disabled (max <= 0); goal will fall back to "scan_interval" (ticks).
[2025-12-18 22:34:09]
[2025-12-18 22:34:09:842 INFO] [Json] minecraft:zombie | minecraft:behavior.nearest_attackable_target | minecraft:zombie | For entity zombie, "attack_interval" is disabled (max <= 0); goal will fall back to "scan_interval" (ticks).
[2025-12-18 22:34:09]
[2025-12-18 22:34:13:686 INFO] [Json] minecraft:creeper | minecraft:behavior.nearest_attackable_target | minecraft:creeper | For entity creeper, "attack_interval" is disabled (max <= 0); goal will fall back to "scan_interval" (ticks).
[2025-12-18 22:34:13]
[2025-12-18 22:34:54:051 INFO] Package: com.mojang.minecraft.dedicatedserver
[2025-12-18 22:34:54] Version: 1.21.131.1
[2025-12-18 22:34:54] OS: Linux
Server start: 2025-12-18 22:16:58 UTC
Dmp timestamp: 2025-12-18 22:34:54 UTC
Upload Date: 2025-12-18 22:34:54 UTC
[2025-12-18 22:34:54] Session ID: 0eaa4500-9918-4b6a-b9c8-38d9743gd5e0
[2025-12-18 22:34:54] Commit hash: 3c929d6fc41f48b65a9ff77078f269f25e6c9b9b
[2025-12-18 22:34:54] Build id: 39746295
[2025-12-18 22:34:54] CrashReporter Key: c1c245bb-499a-34dd-85b3-0ef39863974d
[2025-12-18 22:34:54]
[2025-12-18 22:34:54] Crash
[2025-12-18 22:34:54:052 INFO] at clone (UnknownFile:?)
what do u think
hmm
first up you shouldn't show their xuid
this crash message doesn't clarify much.
i changed it
those are random datas
examples
presumably a data file under world/db is not found maybe?? what does the server display to the clients when it crashs tho?
everything crashes bro
nothing shown
like everyone get the same message
server crashed
so it's instantaneous?
yep u see
but the most obvious and most possible is that the player's data is corrupted
The question is how to fix it ._.
Like is it possible to copy his key value ?
And put it in another local player things
try using this: https://github.com/8Crafter-Studios/Bedrock-World-Editor
I'm gonna grab a couple nbt editors for you
i personally don't know much about where the players' data are in the database
U need to use add-on . That write dynamic proprety
this seems pretty fine
I am already using it lol
oh lol
Thx u for helping
well if you need help with the nbt editing, i can guide you
if you share screen showing the editor
No problem i dealt with nbt before
cuz i am not sure of the structure fully
Thx u so much
no worries
it says converter but it also lets you edit world settings (it's just an extra, if you aren't happy with the one before, anyway good luck)
Like ypu know how a tp setblock fill ect when you add coords accepts ~ as a current notation can i get a custum command to do that or would i need to code it in i knowbi could code it in pretty easily but idk if its a built in thing already
Idk try it and find out
Either takes 0 0 0, or nothing
Or throws error cause you set param to take int
Damn 💀 🫡
But there is a fix to allow ~ just needs to accept string then tries to parse int if it can sets it if it cant checks if its ~ if so sets it to players loc
Sorry im speaking in pseudocode
Is that beloved typescript i see
Only real sigmas prefer JSON over Typescript 🗿
Json isnt even a coding language 🥀
Is there a way to get world builder without turn oning education features mode
Huh json isn't even a programming language ☠️
It s part of typescript
And JavaScript
That s like saying only real sigmas prefer Hypixel over Minecraft
Thats falsy
It makes no sense ☠️
It makes sense to JSON UI developers
It is not
Anyways
Does anybody know how to do that /wb command
Without the other features i don't needs them
Or i need to disable them using chemistry add-on from the game
you need to code it in
uh uh uh, you can use bun and other stuff and run it. however you can't “run” json. json is a data format sir
/connect localhost:3000
/wsserver localhost:3000
you gotta disable websocket encryption in settings and enable websockets tho
otherwise you'll have to go through the hell of making the encryption layer Minecraft expects
it's pretty easy tho, just take a string param and do something like:
It is more of a superset
If you create an interperter you can technically run json files
nope
it's a language in it's own
it's a superset if you choose to compile it
right but what exactly are you gonna do with it? it's a data format. unless you add custom expressions and such. and in that complexity, just why? use TypeScript, JavaScript or any other real language.
What I’m gonna do? Nothing. I just made a joke that JSON UI devs prefer JSON over Typescript
const axes = ['x', 'y', 'z'];
function parsePos(param, player) {
const a = param.trim().split(/\s+/);
if (a.length !== 3) return;
const v = a.map((s, i) => {
const axis = axes[i];
if (s[0] === '~') {
const off = s.length === 1 ? 0 : Number(s.slice(1));
if (Number.isNaN(off)) return null;
return player.location[axis] + off;
}
const n = Number(s);
if (Number.isNaN(n)) return null;
return n;
});
if (v.includes(null)) return null;
return { x: v[0], y: v[1], z: v[2] };
}```
i coded it on the fly, and grabbed a couple stackoverflow answers and put some of them in here. you are welcome to change the function as much as you want.
this doesn't handle '^' btw
so yea
sorry i meant what are you gonna do with it
i guess i didn't get that it was a joke
anyway that's no excuse, I'm sorry for my behaviour, have a fantastic evening!
parsePos('72 ~-6 ~88', { location: { x: 0, y: 393, z: 9 }})
you can use that in a js console and make sure the math is right, cuz i didn't get a chance to test it, sorry
I'm wrong on this one too
it's a superset; cuz all javascript is kinda valid typescript, but typescript extra stuff isn't valid javascript and typescript adds lots of new stuff to JS.
my bad, sorry.
So ts is just a cover, but still have to convert the ts into js but with type detectors and stuff from ts
nope
your message is a bit vague
So ts is another code language itself?
but I'll clarify what i mean.
ts can be ran by itself using tools like bun, ts-node, tsx and many others
they let you run typescript itself without compiling to js first
but yes in most cases you must compile to js first before typescript is ran
kinda.
like i said before, it's superset.
Ohh I see, my bad lol. It’s alright haha
Alright thanks
and whether you need to compile it to js to run it or not depends on the context.
no worries
it's my bad, trust me. I'm very sorry.
ah well, thanks and have a fantastic evening!
World builder bro
i believe i am wrong.
while this could be correct, no correct tool enforces types at runtime, not any that i know of. so that renders my information incorrect.
this is what happens actually:
tools like bun:
→ parse ts
→ strip types
→ lower syntax (if needed)
→ JS
→ execute
Lol
It is in education version
hm
But i don't know what it used for for a reason
i heard of a similar ability
in /ability command in normal bedrock
tho i could be entirely wrong
is there any docs on that outta curiosity?
nope
that's why it's extremely hard
if you're talking about the encryption ofc
if you're talking about the packets and how to init the websocket server, then there are LOTS of docs
yeah, i was wondering if anyone knew how minecraft expects it on websockets
do you have an readily available, i've got nothing better than to look
Minecraft lets you connect to a websocket server when you’re in a game. The server can receive and send any commands. This lets you build a bot that you can … (well, I don’t know what it can do, let’s explore.) Minecraft has commands you can type on a chat window. For example, type / to start a command […]
i can send you my relay.js if you want it too
(it just uses the reload command)
here have a portion of it
const cmds = new Map();
function runCommand(command) {
const uuid = crypto.randomUUID();
cmds.set(uuid, command);
return {
header: {
requestId: uuid,
messagePurpose: 'commandRequest',
version: 1,
messageType: 'commandRequest',
},
body: { commandLine: command },
};
}
const wss = new WebSocketServer({ port: PORT });
const clients = new Set();
wss.on('connection', ws => {
console.log(kleur.green('📡 Minecraft connected'));
clients.add(ws);
ws.on('message', msg => {
try {
const parsedMsg = JSON.parse(msg.toString());
const { body, header } = parsedMsg;
let out = [];
if (header.messagePurpose === 'commandResponse') {
const cmd = cmds.get(header.requestId);
if (!cmd) out = ['Command Ran!'];
else {
out.push(
kleur.blue(`${cmd} `),
body.statusCode === 0 ? kleur.green('Ran Successfully') : kleur.red('Failed to run.')
);
if (body.statusMessage) out.push(' — ', kleur.gray(body.statusMessage));
}
}
console.log('⬇️ ', out.join(''));
} catch (e) {
console.error(kleur.red('❌ Bad WS message'), e);
}
});
ws.on('close', () => {
console.log(kleur.red('❌ Minecraft disconnected'));
clients.delete(ws);
});
ws.on('error', err => {
console.error(kleur.red('❌ WS error:'), err.message);
});
});
async function syncAndReload(pack, runBuild = true) {
try {
await pack.run(runBuild);
console.log(kleur.green('✅ Sync complete'));
const cmdStr = pack.isBehPack ? 'reload' : 'reload all';
for (const ws of clients) {
if (ws.readyState === ws.OPEN) ws.send(JSON.stringify(runCommand(cmdStr)));
}
console.log(kleur.cyan('🔄 Reload command ran'));
} catch (e) {
console.error(kleur.red('❌ Sync failed:'), kleur.gray(e.message));
}
}```
it's a bit messy but I'm sure you can use it pretty well
it's an old blog but the packet structure is the still the same.
If it's crashing that fast then there isn't anything you can do, that I can think of, in regards to logging and knowing who it is when looking at the file because it's unsaved data. Unless the data is written before the crash you are limited on options.
Yeah
Is there a way to make recipe only for creative players not survival?
yes, but you have to change the gamerule that allows players to craft not learned recipes
and the player in survival can pick up that item, you might need a ticking function that constantly removes the recipe from the player if they are in survival.
Im not sure if fixed yet but last i checked fo limited crafting was broken
@cyan basin Is there a way to make the inventory clickable?
This is for your Chest Form release
Is it not clickable already? It should be...
I'll recheck the files, for me now, it is just shows the hover, cannot click
The GitHub was updated last week, you can check the container type being either "container" or "inventory" and click either one
both types start from 0 too to make the functionality easier as if you're checking a chest or your own inventory like vanilla
Yeah, as of now, for me, inventory button aren't clickable.
import { world } from '@minecraft/server';
import { ChestFormData } from './extensions/chest-form/index';
import { MinecraftItemTypes } from './extensions/vanilla-data/index';
world.afterEvents.itemUse.subscribe(({ itemStack: item, source: player }) => {
if (item.typeId !== MinecraftItemTypes.Compass) {
return;
}
mainForm(player);
});
function mainForm(player) {
const form = new ChestFormData().title('Main Form');
form.button(12, 'Grass Block', 'minecraft:grass_block', { amount: 1 });
form.button(14, 'Diamond Sword', 'minecraft:diamond_sword', {
description: ['§7Sharpness V', '', 'Test (1)', 'Test (2)'],
durability: 50,
enchanted: true,
});
form.show(player).then(({ canceled, slotIndex, type }) => {
if (canceled || slotIndex === -1) {
return;
}
if (type === 'container') {
world.sendMessage(`${type}, ${slotIndex}`);
}
else {
world.sendMessage(`${type}, ${slotIndex}`);
}
});
}
Tested using this code and github code
That's weird, maybe I forgot to push it. Let me have a look
Thank you for your help.
Are you using the typescript version on GitHub?
Use this new file: https://github.com/Sprixvy/Chest-Form/blob/main/Resource Pack/ui/chest_ui/inventory.json
It should make it clickable now! 👍
I think i'm using the javascript version
The file should still be the same
That's just where I updated it for now
There, I pushed it to both so you can get it normally now
Today has been brutal wheres the nearest cliff
it works now, thank you so much!
No problem glad i could help 😛 steals credit
Whats the syntax to setting lire on an item with script
item.setLore(['lore'])
Do i do it after its set to inventory or after i save its dp or does it matter that much
you need to do before you run the setItem method.
otherwise you are just setting the itemStack in the slot with no changes
Can i take off minecrafts lore is that possible
no
Have to set the item again
you dont
run all the edits before the setItem() method.
that's what I was trying to say
alright.
Found a bug
Interact events on fletching tables will not stop firing making form use on them unusable
Can i texture a block like the fletching table without downloading its png
its every block thats not interactable and just check if isFirstEvent property is true.
Thats not true tho logs work fine ive used grass ive used plsnks
Oh theres an isFirstProperty do i run that check before i call the command
it is.
unless you are using an item on it that interacts with it successfully, then it is true.
No ive been having no issues using any other non interactable block it wasnt til i used fletching table i had issues
show me a video then, of you interacting with dirt.
I did oak logs
you said any other non interactable block.
did you interact with an axe or no
show me a video where you interact with the log then and console.warn/log a message.
i hope that 1 worked
what
then it'll place the block, which will make it only run once.
dont have anything that'll make you swing your hand.
uh
Im going to kill minecraft
It crashed for the 8 billionth time today
But what is the is first propert
How do i set it
do you understand how you were wrong
you dont set it, you check for it's value
This was the first time ever having the isdue ever and my god friend oaky was always by my sidr
Stealing my money but always by my side
what
Dont read to much into it
So is the is first event a player property on the event itself or?
its on the event.
Set it to true correct
you are not setting anything.
Oh is just ev.isFirstEvent
even if you were editing the property, you'll get the property the same like this
yes, thats correct
I tried it didnt work
then you did it wrong
Or do i do it before the xancle
please show me the code.
all you did was put ev.isFirstEvent in the code.
yes i thought thats what you said to do
ok but im guessing its not how do i make it true
are you messing with me right now
i could ask you the same question
okay so you are just not following along correctly.
I told you like twice, you are not editing the property
you are going to check its value
how is checking its value going to help me make my fletching table useable tho
you want it to stop spamming...
Yes but knowing its false doesnt really help me when i cant set it to true
This value will be true if the event was triggered on players initial interaction button press and false on events triggered from holding the interaction button.
I triggered it just bu using the use button itvtriggered multiple times
are you going to do what im telling you or not
the code
you are not checking its value
how is that not checking its value
I mean technically you are, but what do you think this means in coding
use an if statement
check if the value is true
Ok checking its value and protecting with if are 2 completely dif things
no, you just didnt understand what I meant
plenty of people explain things like this
No i did what you said you misused logic
I like outplay but why wont the dam thing stay open
clearly you didnt if you did the wrong thing like twice
No i did what you said keyword said
I didnt do what you were expecting cause what you said did not iterate that
No its on you
cant fight with someone like this
You mean ppl who use correct terminoligy then dont fight but dont accuse me of not doing what you said just cause what you said wasnt what you ment so good night
lol
Ill adk my it instructer start of semester what he would do if a person said to check the value of something
okay.
the whole time ive been doing this shit, this has never been a problem
you are the first person I met thats been confused by what that means
Because i was told what checking a value actually means
if you dont like my terminology, whatever. doesnt mean its wrong.
in reality it couldve meant both things, sure, but what I meant made more sense than what you did
Im not saying you were wrong but it doesnt mean it cant be confusing when we were taught different terms
Not when it dodnt indicate that it ever was true
the documents say so
From my logging it said false so msny times i didntvsee a true
I didnt read every doccumdnt never assume they all are read i still hate the doccuments
"misused logic", how is that not saying I was wrong
anyway I will admit that I was little harsh
this couldve turned out less argumentative if I was less condescending
Did i really name my 2 statistic type dp levelStats and levelSystem
My naming logic could use work

No if i named it fox it wouldnt fit
Chat gpt saves me a billion times catching the small things i misd
Hm is there any way to import camera animations from blockbench to ingame, like with any code or so? 
That isn't scripting, but no.
hello guys
does anybody knows how to edit .ldb files
man , nbt editors don t do their work as it supposed to be
does anyone know why I can't use the player selector in custom commands when I'm not operator
It says selectors can't be used or some bs
No problem either way 👍
Can some please help me with some code I can use to detect when a player is Drawing and also has released a custom bow item?
They have been disabled for members I think
Due to security issues
I think you should be able to enable them for everyone
Wdym?
like the player selector command enum?
Yeah
You could find bases using that
And crash servers
You mean those @ selectors right?
No but its happening even if I just type the players name
Oh
like im doing /tpa zcozmozzz and it says "selectors aren't useable" or whatever
only works when I'm op
Weird. Maybe there is a different enum for player names
Am I missing something?
Haven’t ever used custom commands so idk if that’s even possible
I did CommandParamType.PlayerSelector
Idk someone else has to help :/ sorry
Can some please help me with some code I can use to detect when a player is Drawing and also has released a custom bow item?
You can just use the itemStartUse and ItemStopUse events
Alright give me a bit
A bit of time or code?
const player = event.source;
const item = event.itemStack;
if (!player) return;
if (item.typeId !== "your_namespace:custom_bow") return;
player.addTag("bow_drawing");
});
world.beforeEvents.itemStopUse.subscribe((event) => {
const player = event.source;
const item = event.itemStack;
if (!player) return;
if (item.typeId !== "your_namespace:custom_bow") return;
player.removeTag("bow_drawing");
// Optional: add release tag if you need it
player.addTag("bow_released");
player.runCommandAsync("function bow/fire");
// Clean up
player.removeTag("bow_released");
});```
Like this?
runCommandAsync was removed a long time ago
Oh
3 problems
Number 1 being this
2: stop using beforeEvents there are no benefits towards using beforeEvent here at all
3: there is no itemStopUse beforeEvent because stop use is dynamic to whenever the player's finger let's go of a button
chatgpt try not to hallucinate some bs code challenge impossible
🤣
In fact there's a 4th problem in that you need both itemStartUse and itemStopUse or else the concept doesn't work
On the bright side, that's why we're here
Yayy😂
if you write something to convert the json data into a series of camera commands or a script, then yeah
You're gonna have to know alot about camera stuff tho
One of my favourite chat gpt lines if code is in events like this
if (!event.source) return;
Like the event that just happened doesn't have a source
so yeah
well it can differ actually
it's better to safe than sorry
I mean mainly in itemUse
while the API might never fail
it's better to have a quick safe check to ensure everything runs smooth
they don't take much perf anyway
as long as you don't branch then yeah it's safe
It is kinda still a waste of a line though
Does no harm though as you say
Also you might be better off with a dynamic property rather than a tag if you don't want it to be interfered with in-game
It will never be anything but an entity object
.isValid is a better check
Could you help me out with the code? 🙏🏾🙏🏾🙏🏾
Sure
Do you still want the tag or dynamic property
Or do you want just the events and runComamand
lol dude just spend a week actually learning the language you're writing in instead of going "durr chat gippity make me a mcbe script to do x and y"
I'd like the tag with the events and runCommand please 🙏🏾
is this happening to anyone else?
Here
import { world, system } from "@minecraft/server";
world.afterEvents.itemStartUse.subscribe((e) => {
const { itemStack, source } = e;
const player = source;
const item = itemStack.typeId;
if (item == "ltng:power_slam") {
player.addTag('bow_drawing')
}
});
world.afterEvents.itemStopUse.subscribe((e) => {
const { itemStack, source } = e;
const player = source;
const item = itemStack.typeId;
if (item == "ltng:power_slam") {
player.removeTag("bow_drawing")
player.addTag('bow_released');
player.runCommand('function bow/fire')
// this makes the game wait 5 ticks until removibg the tag you have the player
system.runTimeout(() => {
player.removeTag('bow_released')
}, 5)
}
});```
CozmozZz was correct with what he said here and learning will only benefit you
Where could I start?
Also I understand a bit but not enough to fully code on my own
Its a bug, with the player Parameter
is there a fix?
you'd have to just use a string parameter and find a player with that name
or go back in time and stop people from realising selectors can be used to cheat
or go back in time and stop mojang from allowing soulsteel to exist
nah but it seems more like the devs fucked up
i get the selector cheat, but I'm not even using a selector
There's a set of links I tend to give to beginners have a look to see if you've been to these ones already
These are the links I tend to send for those who are new to scripting https://wiki.bedrock.dev/scripting/api-modules
https://wiki.bedrock.dev/scripting/resources
https://wiki.bedrock.dev/scripting/what-is-script
https://wiki.bedrock.dev/scripting/scripting-intro
thats so ass bro do these devs even play test their own game 💔
Fr and the bug was before 1.21.130
I though they fixed it on 1.21.130
I'm gonna test if the entity selector works later
watch them take months to fix ts
What is the block tupe id for mangrove logs i feel its not minecraft:mangrove_log i could be wrong
it is just minecraft:mangrove_log
Oh ok
Thank you so much, this worked like a charm
Tnxxxx
No problem
What does this PlayerSelector returns, I tried using functions like scoreboard to it but it doesn't work, is it a string type or else
an array of Player instances
Whats the easiest way to just disable striping logs
When i get time and energy ima see if i can get ai to pass the worlds hardest captia
playerInteractWithBlock beforeEvents
edit the cancel property to be true
I know that i got it i just made an arraw for all strippable logs
To cancel if the blick type id included any of it
there's also the log tag, but iirc newer logs dont have the tag
Its all good now i can just add to the array if any other interactable blocks i need to outright cancel exist
should probably use the tag method anyway
for custom logs
because if were to make a custom log, I would add the tag.
My custum logs wont be strippable
does any one has a blog or a video explain how to turn a modalform to a chest UI form?
Thats all i wanted to stop tho i justcwanted to prevent stripping
unless your log has other interactable properties? if so just check if its not your logs.
okay
video blog? i dont think so
and im talking about custom logs that have stripping support
you can cancel that too.
but if you want more help i recommend https://discord.com/channels/523663022053392405/1067870274894172260
no i mean just a Documents or somthing
No need to change it theres only 1 other custum log i need to add minecraft has mire thrn enough wood types
nope "a specific instruction" for creating a chest ui from a modalfrom does not exist afaik
thats your opinion
if you don't care about compatibility, whatever, its your addon.
okeeeeeeeeeeeeeeeeeey ty
if you want a general instruction there are tutorials about the basics
yes i want
Im not saying other ppl woukdnt want or need mire im saying my back doesnt need any more
https://wiki.bedrock.dev/json-ui/json-ui-intro
https://discord.com/channels/523663022053392405/1067870274894172260
and some youtube tutorial vids
i didnt say your pack needed more.
https://github.com/Mojang/bedrock-samples/blob/main/resource_pack/ui
this also helped a ton
Just the way you came off with the "thats your opinion" makes it sound like i was telling other ppl log types they need
My addons for a custum world the way its set up it still wouldnt be compatable with other addons
tysm
is it forced to be this way
or you just didnt care from the beginning
All items blocks ect have custum data highly independent such as xp levels unique recipes
Crafting table is disabled crafters handle time based crafting
A nother addon wouldnt have any if the data on there items
If a pack had say ever green logs
The log isnt in the data no level no subtype so its just a blick without a use
I cant tier unknown blocks
Birch log for example on mine is tier 2 where oak is tier 1 burch nakes better stuff
you could totally add compatibility by making an api for it
Other addons would need to code there blocks into the api so sure i could do that way
I think the something here is whats more importaint
they didnt.
Cause what its running could be why
Then why it didn't work lmao ?_.
Show the code
I don't have it for the moment
Then we cant help til you do
I just put something simpl like
console.warn("something")
And inside playerJoin event
No syntax errors from that
Just it doesn't show the warn after 3 seconds and at all ☠️ no errors triggered
The file imported to main
index.js u mean ?
Also is it taking longer then 3 sexs to load
whatever your entry file is called
Wha what ☠️ ... ?
I know the file work
Whatever you use as main if index is your main yes
what a mispell
Everything above the runTimeout code run
And afer it
I see warn that i wrote before it and after it
I misspelled misspell
Try longer time
And they both work
shouldnt need to.
But the runTimeout it self dosen't give me any results
im going to try to replicate what you are doing 1 sec
Go to PlayerJoin event afterEvents
Your mostly right its just to rule out mc player join nonsence
ik
I wrote it Just to be more specific
works for me.
No way
Its probobly a typo or missing element in your code
The Earth's solutions have run out. it's time to open the PC and copy the file.
I mean the code
Ok guys i found the problem it was an if statement ☠️
Thatll do it
does your repost still works in the new minecraft version? @valid ice
Did i saw some message or i am just tripping
forget to mention
Ok
@thorn flicker the issue with my pack being compatable is that all weapons rely on custum data
You add a weapon in another pack
Theres no level no crafting recipe that uses my system no xp it cant do damage cause vanilla cb was rewritten all ores and wood are tiered and level lovked another oddon would not
And this is a story driven factory craft quest derived nap
Map but ill take a nap sure
oh its a map
Yes
who cares then
Ya my addon wouldnt work on its own
So wude
How janky will it be having yhe mines tech in the same place but running a structure load tp and function each level you go down so with coords off looks like descending
mines tech?
Technicually
do people say that
Yes
frr thats what i though
Where i live its common
Voids being mesn again
Anyways how janky will that feel
If only Entity.teleport(... { keepVelocity }) was supported for players...
Well, you can still make it +-smooth
☠️ what type of slang u'll using ?
Entity with collision im confused on thatc1
|| "will using" ||
no?
No not really
I think we lost translation there
I was just guessing
I guess so.
So again, what do you want to do?
that describes an elevator to me but maybe my brain is just descending
So im making a mines each level mines are randomly fenerated got a funt to generata componrnts i was going to use randominsed structures to replace current structure each time you complete a mine floot
I was wondering if i technicually just reused the same area if that works ir janky
I remember I made something similar about like 5 years ago...
With a good TPS this can be done quite smoothly... I guess
I started getting into command blocks when I was 11, and made this "mine" when I was about 12
I didn't even touch addons
Define good tps
Id tp player to start start will match on each mine floor then generate random structure then run my spawner funct
ah
18-20
☠️ dude i ain't understanding nothing
18 to 20 what
Ohhhhhhh ticks per second
maybe commas would help
these are different things
Isnt ticks per second always 20
20 is the perfect maximum
Well either way sounds like just speed lag related so ifva players lagging it nay feel janky but tbh all mc feels janky in lag
Well, if I were you, I'd save player.getVelocity, then teleport it, and then use player.applyImpulse(savedVelocity)
Well yes ofc and ooh that gave me an interesting idea
is there any way to rotate an entity to face a point? like a vector3 type or something
Entity.lookAt(location)
Is there a cap on item lore that i should know about
yes
My sanity threw a null reference exception
which is better? use a single runInterval but compiled with 50 Lines or multiple runInterval?
depends
on the logic
almost everything nowadays doesn't need runIntervals
so try to use less runIntervals
Single runInterval. Having multiple just doesnt make any sense, the purpose of all is just to run at same time. If you need multiple delays, just use runTimeout inside the single runInterval
what? No dont run a timeout inside an interval if you want delays. you have to either check the current tick or run a different interval
but not in an interval? unless you use an if statement cuz it will spam with timeouts
Hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
rel
confusing
i think i explained well
runInterval(() => {
runTimeout(() => {
sendMessage("hello")
}, 2)
})
each tick, runTimeout fires, SO the message fires after 2 ticks.. Then again next tick runTimeout fires, so that is delayed too.. meaning 2+1 =3 .. is that a sequence... 2nd tick, 3nd tick, 4th tick
it will spam the timeout no?
Huh
it runs the timeout each tick
why would anyone want a delay?
wdym spam, can't u think tick-wise?
wdym think tick-wise
yeah and 4, 5,6,7,8,9... all after that 3 tick the timeout is being ran
wait
maybe i am
thinking off this
for (let i = 0; i < 14; i++) {
system.runTimeout(() => {
sendMessage("hello")
}, i)
}
uhm
so for example, for 14 times, the delay increaese
and creates a delay sequence
as the i is used in the runTimeout delay value
does that go to system.runInterval too? ok maybe not
That only executes many timeouts
I think runInterval itself is a shortcut, you just have to adjust the tickz
I'm sure you know this:
let i = 0
const id = system.runInterval(()=>{
i++
if(i > 14) clearRun(id) //stops if more than 14
}, 20) //runs every 20 ticks
Goys i want to ask question
no 
jk feel free to ask stuff
Sad
So i want someone to fix my server for me ._.
And it have like 17 add-ons and 5 issues ☠️ and some corrupted player's data
And i found someone and told me 100 usd for all that ._. is that too much or too low ? ☠️
Because i found that 100 dollars is too much for me ☠️
idk
depends how those addons look
and depends if you are going to make profit out of that
or if you aim for pure fun and no profit
Some profit would be
Like i got inverstors
Is it fair guys, knowing that i gave him the job three days ago and he got 80 of the job done ?
like 5 issues seems kinda easy to fix
but we got not so much info about this
Corrupted data , like 5 main issues , the log file is full of issues
Recipes issues
Json damage issues
And [ block Error ] issues
And some mobs don't get displayed correctly
And 17 add-ons ☠️ to work on them
Did you paid him
I paid him half upfront
But i am considering completing the other half
I don't know even if 100 dollars is much or not for that work
Is it underpayment?
Or overpayment
What is the standard, i don't know to be honest
idk either, havent ever gotten paid to fix a ton of addons
if it got big and many issues 100 could be worth
Is there any one that fixed an add-on before ?
In ur pov do u think u will get that job for 100 dollars?
But u should know there are 17 add-on to go through
And not a small one liek big ones
Like better on bedrock add-on and more
Like big work to do ☠️
I would go through the addons you give me, and see how many error are bieng shown and then if its reasonable then sure
Bro many
Like item, block , animation errors
Even scripting itself
☠️ like there is whole file of logs full of errors to fix
Like u gonna spend 3 days to fix it
Or more
im in a need of money so i would accept it if it would be possible considering my own knowledge of addons
Hmmm
So if i gave u 50 dollars would u accept it ?
this a small overview of therrr
errors
@last latch
And there is more like x40 than that
100 dolar is overpayment
LMAO i would do it if i had a better pc and a credit card to accept the payment
if there is the same error over and over expect it to be fixed only one time
it seems like an overkill with 100 bucks
is it possible to get a list of all possible enum values for a entity property?
nah i count them before
there are like 30 or more
lemme count
so u gotta like 200 items and block in total to work on
idk but i can say your damn rich to have 100 bucks
☠️ man i only payed him half
aaaaaaaaaaaaaaaaaaaaaaaaa why does it moving with water when it has "minecraft:buoyant" COMPONENTS
That's not a scripting thing.
I'm a good scripter and accept comissions
I can do it
if you want
make it immovable
but there is no component for making immovable in water
i think youre quite late lol
did he already pay you or wha
According to their messages it’s 50 out of 100
Those errors are all easy to fix
Yeah kinda
oh hell nah
bro got brutally scammed
@amber granite noway
I could fix that in 5 minutes tbh
as long as they are happy with the results shouldnt really matter with the moderate overpay
that's not how it works tho
That's a type of scamm
taking advantage of someone who doesn't know just because you were the first one to find him out
You know you won't take a lot of time doing it but since he started saying he would overpay you just take advantage
thats fucked
that is not a scam
indeed it is
it is more unethical but scam is something different.
noted, th8s is what i'm thinking about
If the developer did not manipulate the payer in any way, either by lying, hiding information or deceiving the payer it wouldnt classify as a scam.
How to make images in Form UI render more clearly?
no possible way
there is. Either by shrinking your safezone or your ui scale in settings
but that is impossible to control via scripts or json ui (afaik)
yeah ikn sorry abt that
does PlayerSoundOptions.volume even work?
i set it to 0.01 and it is still loud as freak
Okay nevermind
it just did not update for some reason
Damn
Anyways
How to check if someone is OP ?
if (player.playerPermissionLevel === 2) { ... }
Dosen't work
it does tho
show exact code
maybe you have custom permissions?
that would be 3
operator is 2
Undefined
like i said earlier, could you show the exact code you have?
One min
does changing manifest uuid cause lost of access to the packs dynamic properties/ tables and etc?
Yes.
does importing an mcaddon override the corresponding addon with the same uuid? or not
if it version is higher, otherwise it is considered a dup and ignored
you can go back to the old uuid, the dp are not deleted
higher or equal to? or just higher
higher
I have never experienced a pack being overridden by a new version, it's always installed the different versions as separate packs for me
Same uuid?
what might be the cause of client stuttering when you are the host and you re running an heavy script?
Entities, rendering, particles,
Tell us when the suffering happens, for how long and how it looks like
rendering a minimap, but its a script, the game isnt giving any spikes warning and the server isnt lagging, the client is
More JSON ui related no?
nope, i deleted the setActionbar line and it didnt change anything
If only the client is lagging, must be related to rendering or client bug
So either particles, entities, world rendering, or your JSON UI
Are you sure the JSON UI is not the issue?
100% i deleted the setActionbar line and if i stop the rendering loop script it does not lag
no entities are in the world, and im not using particles
i found the issue (chatgpt did) i was setting the inputpermissions to true every tick making the movement stutter
Guys does anyone knows why creator's skin dosen't work when i override player.json in entity textures
So i applied an add-on but creator's skins dosen't work
With it only classic ones
Depends on hourly rate. Which really differs depending on your country/relative cost of living. People with lower cost of living have therefore global advantage of underbidding
U mean i scammed him or he scammed me ?
Ofc it s not my money only - it was other server's admins money too


