#Script API General
1 messages · Page 82 of 1
its fine
It has been replaced with a more verbose permission interface.
Documentation for @minecraft/server
thats only available when registering commands though no?
i need to send a different message based on if the player has operator privileges or not
Done, sorry for clogging the channel
player.playerPermissionLevel
oh okay
thank you
im guessing thats preview only
i dont see that in the base game
well that sucks
2.1.0-beta
at this point i may as well make realms and serves in preview and force anyone who actually wants to play to download preview 😭
It's coming. Don't worry. isOp isn't recommended anyways. It's not consistent between Realms, BDS, etc. Their new logic helps to bridge the complexity of their permission levels under the hood while probably saving them from having to refactor it in the game lol.
anyone here good with math?
depends is the math 2+2?
dot product related
What’s up
Hey
Does anyone know if it'd be possible to patch this duplication glitch by clearing a player's crafting table slots on join? https://youtube.com/shorts/URw-Hc3ylPk
📝 Description
Hello there everybody and welcome to Rediscover Redstone! In today's video I will show you how you can do this super simple duplication glitch in realms. I really do hope you enjoyed this video and if you did a sub or a like will be greatly appreciated - sub to see more useful farms and glitches for Minecraft! Thank...
i want to get the angle between the player view vector and the movement vector, but the view vector is relative to the, world while the movement vector is relative to the player. that throw things off a bit when calculating that directly, velocity vector work but that not possible with my use case
so basically i want to turn the movement vector to tell the direction relative to the world
not possible
Movement vector is relative to player… how?
Copy full inventory, run clear command, set inventory back
Best you can do, afaik
Ah no crafting table access like java, I see
Would clearing full inventory also clear the crafting table?
moving forward for example don't change the vector no matter your rotation
Yeah, I thought crafting UI would be just one global UI rather than one per block
Ah wait, I was reading the wiki which shows inventory crafting...
Maybe break all crafting tables and replace in range of a player when they join?
i think i got it
but it is returning only positive angles, no matter if i moved right or left, forward or backward
Alternative idea: Get a custom entity which loads chunks, when a player leaves, summon one at their body which may patch it as chunks stay loaded? idk what the root issue is
Idk what movement vector returns- is it like, x=1 for forward or what
just added signed angle to my angle function and that fixed it
-# thanks for considering helping me herobrine
~~i am guessing you have no idea what i am talking about, lol
i needed the angle between the player view and movement, there relativity is different so a simple calculation didn't work
so i just subtracted the player view direction from his movement to get the movement relative to the world, and used that to calculate the angle
is this right or am i complicating stuff?~~
nvm this shit, idk what i was doing
what did you try
That doesn’t feel right, but I can’t really look into it at the moment
alr, lol
const vec = player.inputInfo.getMovementVector();
if (vec.x === 1) {
console.log('left')
}
it's not printing the text when im moving left
Log vec and see what it is returning
0.7415120...
That sure ain’t equal to 1 😛
there is diagonal movement too
does the value change depending on the device? there is a bit of offset
for me it's giving between 0.5 to like 1
I fixed it
Is it possible with script to fade in a night skybox with time of day?
What does this do because it works
tells you the direction a player is walking
This is the code I used without using the as any

Would I ask here if I need help setting up a UI config for drop rates ?
That’s fine to ask here, or if it’s a deeper topic, feel free to create a forum post in #1067535382285135923 . If possible, include the relevant code you’re working with, what issues you’re running into, and any error messages if applicable. Then give folks some time to respond.
If you’re hoping someone will write something from scratch for you, keep in mind that the chances are pretty slim, this server’s main focus is helping developers with existing issues, not offering free commissions.
Think of this server as “for developers, by developers”, a place to collaborate, share code, troubleshoot, and grow together.
i am just really struggling trying to understand how to do what im trying to do and whether its even possible, and i keep trying to look at examples and i think thats making it even worse
What are you trying to do
and i dont even know if i can properly explain it.
i made a ui using actionformdata. Theres a Category in there that im trying to lock the items within that category from being clickable until the player acquires the item for the first time.
and im also trying to make a configuration for drop rates and mobs spawning with the items rate.
i understand that i can not do that within the actionformdata? but im hoping that i can use the same format ive been using within my form to maybe give the player the config when they click on the button. and then remove it from their inventory after they have submitted the changes
this is my ui so far, i stopped because i dont know if this is the right way to go now
im only trying to lock the items within the "Cosmetics" category
i can not wrap my head around modalform
or how to make the game save that info, i tried looks at jaylys statistic addon and ended up more confused
and the (Math.random() <= 0.01) in both the holidays and legendary drop configurable for the player.
Thinking that it be where i can make a button withing the how it works category that leads to the ui giving a settings items?
Is it possible to overwrite a death message with a custom one
world.beforeEvents.entityDie doesn't exist and setting the death messages gamerule to false at the start of the actual entityDie event still lets the death message show up
Unless beforeEvents.chatSend works
but I doubt it
it can't detect system messages
You can't lock it in script api, you can only ignore it or make it open the same form
Can't you do something like
import {VanillaEntityIdentifier, world} from "@minecraft/server"
const dim = world.getDimension("overworld")
dim.spawnEntity("id:name" as keyof VanillaEntityIdentifier, {x:0,y:0,z:0})
tbf it was just like an extra feature i wanted to add where the compiled cosmetics also act like a collection of sorts. Would it be possible do the other thing with the configuration and getting the config setting from the ui and it disappearing after submitting the changes?
Didn't understand some parts, you want to hide some options conditionally?
ignoring the cosmetic collections thing.
The biggest thing for me is setting up a configuration for the player to be able to change the maths in the entitydie. I'm not understanding how to set that up
but i was also trying to lead to it through my ui somehow, as i understand i can no set a configuration within my current ui itself?
and it actually requires modalform? which i can not wrap my head around how it works
const form = new ModalFormData()
form.title
form.dropdown
form.textfield
form.toggle
form.whatever else
I guess it's the making the math configurable in the first place and saving it because I don't understand how the modal will help me but it's what I was told I need to use when I asked someone
explain better what do you mean by "math configurable"
am i the only one that cant get their pack out of 1.21.50?
like ill change the min engine and everything up to the latest stable like 1.21.70 for 1.19 api and doesnt give me an error but stuff dissapears
i have no clue why. its done this the last few updates. i have not been able to update my pack since the pale garden
thats why im confused is ive never had this issue
always just been able to update min and format version and keep going but idk what the issue is
could it be gametest maybe thats breaking it
21:04:47[Blocks][error]-block_definitions | C:/Users/ZoMb1/AppData/Local/Packages/Microsoft.MinecraftUWP_8wekyb3d8bbwe/LocalState/games/com.mojang/development_behavior_packs/Blushrooms BP | blocks/leaves/goom_goo.json | itemGroup.name.netherWartBlock | Identifier must have a namespace
found the error but i have no clue why im getting it
at some point they made spawnEntity autocomplete vanilla entities so you need to provide either your entity's id or string to it in a type generic ie spawnEntity<string | "my:entity_id">(...)
Allows you to create a GUI with actions, messages, and modals.
How can I add lore to crafted items without any ticking?
You cant.
Do you remember by any chance how to do item descs in lang files?
the best you can try is to add a line break and another translation key in the item name
I don't think line breaks work on lang files
yes but in the behavior pack, however...
But I do remember there was a way to add them, that's what im asking
this is what better on bedrock did
What im asking
Will that not be the same in all languages like display method used to work
Display method has always supported translations.
You would need to verify but I'm pretty confident crafted items trigger entitySpawn. If true, then you could use that to handle the ItemStack and add lore. If it works, make sure you utilize early returns since all entities will cause that event to be triggered, adding overhead. Anyway, this was the only idea I could come up with lol.
-# This may not work 👀
crafted items trigger WHAT
I could be wrong.
omw to test
so i completly forgot about the crafting_item_catalog.......
You could actually probably detect inventory change now.
But thats not foolproof.
well thats inventory change, sooooo...
If anyone tests entitySpawn, report back lol.
im doing it rn
And pray tell, what happens to your inventory after you craft items?
i shouldve specified... i meant like grabbing the item in inventory with mouse
:(
Well, you jusy have to wait for the crafted item detection event MOjang is planning.
Was definitely worth a shot.
yeah
...no
wait no json ui involvement?
pretty sure microsoft docs have one
I found it nevermindd
Idk what you mean but https://github.com/Mojang/bedrock-samples/tree/preview/resource_pack/fogs. Also wrong channel.
yeah i just found it there was many options
oh i forgot the existence of bedrock samples
where should I discuss stuff about fogs? #1067870133328027730?
Seems like the right place. This location is more targeted towards scripting.
thanks
when I modify the resource pack / fog.json I need to reopen the world, is there any other way?
/reload all
Is there way to change skin of entity that I attack example I attack zombie then the skin change to pig but it have the zombie behavior if doesn't work maybe I should just make the pig tp to zombie and make the zombie invincible what should I do guys
thanks seawhite
I don't know if there's an entity that does that in vanilla but you can use how sheep shearing works where on_hit it would change a custom_component
im using the playanimation option in the script cause i dont want to use player.json and im playing an animation when the player is riding something i wanna check if the ride is moving before playing that animation is the q.ground_speed of the player increases when the ride is moving?
HUH
Crafted items trigger entiitySpawn?
No
What did you find in testing
world.afterEvents.playerInteractWithEntity.subscribe((event) => {
const entity = event.target;
const rideable = entity.getComponent("minecraft:rideable");
const movement = entity.getComponent("minecraft:movement");
if (!rideable || !movement) return;
const movementValue = movement.currentValue;
const riders = rideable.getRiders();
for (const rider of riders) {
if (rider.typeId === "minecraft:player") {
if (movementValue > 0) {
rider.playAnimation("animation.tralalero_ride_move", {
controller: "controller.animation.tralalero.ride",
stopExpression: "query.ground_speed <= 0"
});
} else {
rider.playAnimation("animation.tralalero_ride_idle", {
controller: "controller.animation.tralalero.ride",
stopExpression: "query.ground_speed > 0"
});
}
}
}
});```
anyway to make this so it will keep on running event without the interact activation?
cause the idea here is i want to play an animation when the player is riding the entity cuase the entity has a unique walking bounce effect so i want to sync it by making an animation for the player with bounce effect also and stop that when the ride is not moving and change it to the default riding animation of the player, is that all possible without using player.json?
system.runInterval(() => {
})```
no way italian brainrot addon 😭
vibe coder funni "tralalalello tralala"
Put a 1
why
more readable i guess
Bcs it then only runs once a tick
it defaults to 1 iirc
If you don’t put anything its gonna run as often as it can, atleast in the new 2.0.0
So it runs 3 times now iirc
Per tick
i havent noticed a difference going from 1.0.0 to 2.0.0
Try it out
help the animation is buggy
wait is bds 1.21.80 compatible with 1.21.81
Wdym compatible?
can a player on 1.21.81 play on 1.21.80 bds
What kind of update was it?
For hotfixes its usually fine
Ah yeah it was
Should work yeah
Yeah I saw that
it works 🙏
How do I trigger an event when the player is sneaking/jumping. Does it have something to do with the inputButton enum?
player input event
Can you show examples, I can't find it in docs
its not possible without using player json is there anyway to play animation controllers via script side withou using player.json
Optional
controller
controller?: string
Remarks
Specifies a controller to use that has been defined on the entity its not possible you have to define it in the entity using it you have to use player.json
What is the new permission system?
it's used to know permission level of a player
it's not in-game yet
someone told me its player.playerPermissionLevel in preview but that sounds pretty dumb
why is it player.player lol just make it player.permissionLevel if that is the case
Ik. But how will the new one work?
operator has 3 (or 4 levels, i forgot), and each level has its own stuff, .isOp() checks if player permission level is 4, and on a BDS the default permission level is not 4, but the new one will allow you to check if it is lower
Oh
Will it still be compatible with other addons if I use player json in the client side I just defined some animations and activated through scripts in the server side?
there is a way to add to an entity an component group by script?
example: i right click an entity with an item and a componentgroup is applied to the mob
You have to trigger it via events.
world.afterEvents.playerInteractWithEntity.subscribe((event) => {
const entity = event.target;
const rideable = entity.getComponent("minecraft:rideable");
if (!rideable) return;
const riders = rideable.getRiders();
for (const rider of riders) {
if (rider.typeId === "minecraft:player") {
rider.playAnimation("tralalero_ride", {
controller: "tralalero_riding",
nextState: "riding",
});
}
}
});```
does anyone know why the animation plays for once then stops the animation controller doesnt work at all i defined it correctly in the player client side?
Sorry.I had shared my entitydie file. And I'm trying to make the drop rates in that file configurable.. I ended up figuring it out though.
All types of Minecraft modules
does saving dynamic properties on an entity prevents it from depawning?
or does it despawn as usual
No? You are just saving information to that entity which is stored in the world's data file under that specific entity.
how can is sync a riders bone rotation and position to the ride through combination of scripts and molang
does mojang remove ability to put instant values inside ModalForm ?? because in this new version 1.21.80 i keep getting this error :
[Scripting][warning]-Error setting default From coordinates: TypeError: Native type conversion failed. Function argument [2] expected type: ModalFormDataTextFieldOptions | undefined [Scripting][warning]-Error setting default To coordinates: TypeError: Native type conversion failed. Function argument [2] expected type: ModalFormDataTextFieldOptions | undefined
i tried to fix it but it keeps showing the same error even if he was working on the 1.21.7x versions
if u are asking how im using it here is a part :
if (selectedCoordinates.get(player).coords[1]) {
FromToo.textField(
"§o§a[!]§f - To (x, y, z) :",
"the (x, y, z) of the ending",
selectedCoordinates.get(player).coords[1]
);
}```
Is it possible to make an actionform button open a modalform ui?
Yes
How does one do that?
-# Written on Mobile. I take no responsibility for any errors.
import { world, system, Player } from "@minecraft/server";
import { ActionFormData, ModalFormData } from "@minecraft/server-ui";
// Register a basic chat command
world.beforeEvents.chatSend.subscribe((event) => {
if (!event.message.startsWith("!testui")) return;
const player = event.sender;
event.cancel = true;
openActionForm(player);
});
function openActionForm(player: Player) {
const form = new ActionFormData()
.title("Demo UI")
.body("Click to open a modal form")
.button("Open Modal");
form.show(player).then((response) => {
if (response.canceled) {
if (response.cancelationReason === "UserBusy") {
// Retry showing the ActionForm
return openActionForm(player);
}
return;
};
if (response.selection === 0) {
openModalForm(player);
}
});
}
function openModalForm(player: Player) {
const modal = new ModalFormData()
.title("Modal Form")
.textField("Your name", "Type here")
.toggle("Do you agree?", false);
modal.show(player).then((response) => {
if (response.canceled) return;
player.sendMessage(
`Name: ${response.formValues[0]}, Agreed: ${response.formValues[1]}`
);
});
}
-# This is in TypeScript. Convert it to JavaScript.
Thank you
why can't i edit skin id and mark variant anymore using scripting? why did they change it to read only?
and scale
What was your use case?
"geometry": "Array.geos[query.mark_variant]",
"materials": [ { "*": "Material.default" } ],
"textures": [ "Array.skins[query.skin_id]" ]
use entity properties
Devs said there was issues that couldn't be ironed out so they made it readonly. Or something like that.
is it possible to use this on render controllers
yes
can you give me the syntax please
query.property('my:property')
thank youu, also can i change the entity scale using render controllers?
just the visual size? not collision box
in the client entity file there's a scale parameter in scripts
"scripts": {
"scale": "molang"
}
Is it possible for me to change the state of my block when hit by a wind charge like it happens with vanilla doors?
you can subscribe to the projectilehitblock event
thank youuuuu
How can I detect when a player has picked up a custom item?
In 1.21.90, there is a InventoryChange event. You can use that.
Ah so I have to wait til they update or am I just confused lol?
How does something like jaylys statistics detect items have been picked up if it requires a 1.21.90 thing?
Probably runs a block of code in intervals where it gets the players inventory component and basically looks at each slot in the inventory. Not very performant but it does the job.
Am I right in saying this won't work because the chat is already open?
import { world, system } from "@minecraft/server";
import { ActionFormData } from "@minecraft/server-ui";
world.beforeEvents.chatSend.subscribe((event) => {
const message = event.message;
const player = event.sender;
if (message === "!ac") {
event.cancel = true;
console.warn("[] !ac " + player.name);
system.run(() => {
const form = new ActionFormData();
form.title("Simple Test");
form.body("test");
form.button("button");
form.show(player).then(r => {
console.warn("Response:", JSON.stringify(r));
});
});
}
});
If so, can I somehow close chat first or something?
Not reliably. My guess is you should repeatedly try showing the form until they see it.
check if the cancellation reason is "UserBusy", and it'll open when they close the chat.
you should work on registering custom commands instead though.
Ah yeah thanks, just saw this
system.beforeEvents.startup.subscribe(({ customCommandRegistry }) => {
const test = {
name: "kaos:test",
description: "hmm",
permissionLevel: CommandPermissionLevel.GameDirectors,
mandatoryParameters: [
{ type: CustomCommandParamType.PlayerSelector, name: "Player" }
]
}
customCommandRegistry.registerCommand(test, addItem);
});
function addItem(players) {
world.sendMessage(`${players.nameTag}`)
}
What should I do to have the player's name written?
There could be multiple players so you have to iterate over the array
function addItem(players) {
for (const player of players) {
world.sendMessage(`${player.nameTag}`);
}
}
Not wokr
@valid ice Hey! I was just looking at your repo for ChestUI and it's really impressive! Reading on bedrock.dev, it looks like JSON UI is going to eventually break in favour of OreUI. For just simple chest layouts, are there likely to be better methods to use now? Thanks!
Right now? No
Server forms still use json UI, you can’t really switch it until they release editable ore UI for that
Probably not for a while, though
Hmm I see, I'm looking at this other implementation which appears to use entity inventories, though the code is really hard to look through. I believe it might have some limitations though: https://www.youtube.com/watch?v=6Wn5atDLYoY
Ever wanted a clickable MENU/GUI shop or a warps chest item GUI screen like Minecraft Java Servers? Well, now you can with Minecraft Bedrock Gametest. It has brought us so many new possibilities and creations. Create the GUI of your dreams with the Minecraft bedrock (MCPE, MCBE) chest GUI/UI and simple-to-edit files. Get access to the previous p...
If you're worried about things breaking when ore-UI releases, that method would also break
Ah, is there something being changed with how entity inventories work in relation to selecting items? I'm not too familiar with OreoUI's changes yet
Couldn't tell you, as ore UI isn't released for either screen. I see what you mean, though- no, there would likely not be changes as to how items are recorded in the entity inventory
Alright, thank you! What I'll do for now is summon a custom entity with an inventory, and keep it right in front of the player so they can open it. Not too sure on what part of that is possible yet but I'm off to read some docs!
👍
Yeah, seems to be working great with the main issue being you have to right click to open, though it can feel integrated by making them hold an item!
My script spikes for like 120-170ms when loading into a world, is there a way to debug it?
or do i have to manually find it
With this entity component, I really can't work out how to set the number of slots. If I set hopper there's 5, fine. If I set inventory, it's 27 no matter the value for inventory_size. If I set container, it's still 27 no matter the inventory_size. If I define no container type it's still 27
Thats more of a #1067869022273667152 question.
Ah right, thanks
but I assume the projectile will need to hit the block itself in vanilla, it's not like that
planning? did they tell us that?
Yes.
when
Creator Camp.
i swear it can fix my addon
i badly need this event ngl
does causing iframes and knockback but dealing no damage trigger entityHealthChanged event?
Someone here knows if it's possible to make blocks like gravel, sand, stay floating, like common blocks?
is it possible to add a property to a block to prevent pistons from pushing it (ie chests, signs)
I'm trying to prevent players from using pistons on chests
when I spawn a structure it always spawns in a corner is it possible to manipulate that?
how do i get itemstack name nametag doesnt work
if i want to limit configurations to host only do they have to give themselves a tag or is there another way? I'd rather not have to force players to put cheats on
is there any to detect if an item has a specific lore? for example, when the player breaks a block holding an item with the lore "test", the block runs a simple particle command
yes
https://jaylydev.github.io/scriptapi-docs/1.21.80/classes/_minecraft_server.ItemStack-1.html
getLore
Yay 😄
how to get item name
i mean how can i translate localization key in some string variable? like for example console.warn(item.localizationKey)
pretty sure you cant since translations are done via UI iirc
but you can use sendMessage() method instead
oh hey there we go
i was looking for that one but it wasnt there so i thought i was crazy
how do I get the structures in my behavior pack?
I tried placing a structure however it cannot find it
how do I refer the structure form the structures file to the script?
if its inside structures/foobar.mcstructure, you do "mystructure:foobar"
if its inside structures/folder1/foobar.mcstructure, you do "folder1/foobar" iirc
mc.world.structureManager.place(
"pipe:maintenance_room",
player.dimension,
player.location,
);
it cannot find it somehow
is it only for ui? i believe there's also a use for the script also and one thing i know is .sendMessage({translate: item.localizationKey})
@leaden elbow
i overlooked that
yeah i use that
Installation for @minecraft/server
Latest API module install:
npm i @minecraft/[email protected]
Beta API module install:
npm i @minecraft/[email protected]
Preview API module install:
npm i @minecraft/[email protected]
Preview Beta API module install:
npm i @minecraft/[email protected]
Installation for @minecraft/math
Latest API module install:
npm i @minecraft/[email protected]
Beta API module install:
npm i @minecraft/[email protected]
Preview API module install:
npm i @minecraft/[email protected]
Preview Beta API module install:
npm i @minecraft/[email protected]
Installation for @minecraft/server-ui
Latest API module install:
npm i @minecraft/[email protected]
Beta API module install:
npm i @minecraft/[email protected]
Preview API module install:
npm i @minecraft/[email protected]
Preview Beta API module install:
npm i @minecraft/[email protected]
Installation for @minecraft/server-gametest
Beta API module install:
npm i @minecraft/[email protected]
Preview Beta API module install:
npm i @minecraft/[email protected]
theres #debug-playground for this
i saved the structure with prefixes however when files are exported it saved without the prefixes
Prefix doesn't get carried when exported
The prefix changes into what folder name the mcstructure put in.
yep exactly
I I just found out that it refers to the file name
I thought there was an identifier inside the mcstructure file
welp I cannot put prefixes on file names
world.beforeEvents.chatSend.subscribe(ev=>{})
why does this doesn't work on serve
Have you toggled Beta-API?
Does it work in the first place? On the local world?
You can't add "bots" or "anything" on Aternos
#add-ons message
ohh i get it, tnx
Unless you paid for it: #add-ons message
eh nvm, I read it wrong
but is there any other way to force load chunk using scripts?
Make a custom entity with this component
https://learn.microsoft.com/en-us/minecraft/creator/reference/content/entityreference/examples/entitycomponents/minecraftcomponent_tick_world?view=minecraft-bedrock-experimental
Here's someone who already did it on script resource: #1364195448017125406 message
I'm trying to set up configs for the host to be able to use. I don't want to force them to have to turn on cheats. So I'm trying to think of a work around. Is there a way I can give them the ability to turn the configs off for everyone else?
i dont wanna leave this playground, but my phone make me difficulty for modified the scripts
this will be insane
what do you mean
hard to look at?
so theres no way i can use localizationKey for my strings?
permissionLevel: CommandPermissionLevel.GameDirectors,
How do I make this available to all players?
Any?
wdym?
This command can only be used by people who are operators, I want all players to use it.
CommandPermissionLevel.Any
check enum values
CommandPermissionLevel.Any
Thanks
not offensive, but can save a lot of time
I want to show all players names here but without @a,@e,@p
not possible, you're forced to use Player selector
😦
PlayerSelector returns an array of player objects so what you are wanting to do is already done through the selectors. You just have to sort through the array and decide what you want to do with each player object.
he can check if there's more than 1 player
if (argName.length > 1) return
const selectedPlayer = argName[0]
Just keep in mind, that will return inconsistent results. For example, if you execute the code with @a then you get a list of all online players, and getting the first index of that array may not be the player object you desire.
tell me the code in line 56
what scriptapi version?
{
"format_version": 2,
"header": {
"name": "§aBehavior §l§9Sky§fWars §bDeluxe§r",
"descripción": "§7by @Mikelcraft64 \n§8©Mikelcraft64 §7and §9@olive rapids",
"uuid": "5fed7315-954b-0e1b-b75d-df9a10967dc1",
"version": [
2,
1,
0
],
"min_engine_version": [
1,
21,
44
]
},
"modules": [
{
"type": "data",
"uuid": "9e452d4f-4ba1-0618-42e5-401ef62098dd",
"version": [
2,
1,
0
]
},
{
"type": "script",
"language": "javascript",
"uuid": "edba7d22-33a6-1116-59d0-f4d21ab38a0b",
"version": [
2,
1,
0
],
"entry": "scripts/index.js"
}
],
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "1.17.0"
},
{
"module_name": "@minecraft/server-ui",
"version": "1.3.0"
}
]
}
what scriptpai version?
here
can you fix it please?
{
"format_version": 2,
"header": {
"name": "§aBehavior §l§9Sky§fWars §bDeluxe§r",
"descripción": "§7by @Mikelcraft64 \n§8©Mikelcraft64 §7and §9@olive rapids",
"uuid": "5fed7315-954b-0e1b-b75d-df9a10967dc1",
"version": [
2,
1,
0
],
"min_engine_version": [
1,
21,
44
]
},
"modules": [
{
"type": "data",
"uuid": "9e452d4f-4ba1-0618-42e5-401ef62098dd",
"version": [
2,
1,
0
]
},
{
"type": "script",
"language": "javascript",
"uuid": "edba7d22-33a6-1116-59d0-f4d21ab38a0b",
"version": [
2,
1,
0
],
"entry": "scripts/index.js"
}
],
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "2.0.0-beta"
},
{
"module_name": "@minecraft/server-ui",
"version": "2.0.0-beta"
}
]
}
use this
rejoin ur world
Debug result for [code](#1067535608660107284 message)
Compiler found 2 errors:
[36mrank.js[0m:[33m52[0m:[33m16[0m - [31merror[0m[30m TS2339: [0mProperty 'nameMsg' does not exist on type 'Player'.
[7m52[0m player.nameMsg = playerConfigRank.namefront + player.name + playerConfigRank.namebehind;
[7m [0m [31m ~~~~~~~[0m
``````ansi
[36mrank.js[0m:[33m56[0m:[33m20[0m - [31merror[0m[30m TS2339: [0mProperty 'chatSend' does not exist on type 'WorldBeforeEvents'.
[7m56[0m world.beforeEvents.chatSend.subscribe((chat) => {
[7m [0m [31m ~~~~~~~~[0m
There are no errors from ESLint.
It's encrypted, no problem?
send me please
that would reduce performance which could break stuff
There are 11 errors from compiler, and 0 errors from ESLint in this [code](#1067535608660107284 message).
Please read the attached file for the result.
Previously, this script that I sent you belonged to a map that is mine, and I encrypted it for security, but seeing that it is failing, I want to decrypt it.
function tp(user, players) {
const player = user?.sourceEntity;
if (players.length > 1) return player.sendMessage(`§cYou can only choose one player.`);
if (player.nameTag !== players[0].nameTag) return player.sendMessage(`§cYou cannot send a teleport request to yourself.`);
for (const allplayer of world.getPlayers()) {
if (allplayer.nameTag == players[0].nameTag) {
tpa_ui(allplayer, player)
}}}
function tpa_ui(player, sender) {
const form = new ActionFormData();
form.title("Teleport Request")
form.body(`hello!!`)
form.button("Yea!");
form.show(player).then((response) => {
})
}
Not working, why?
yea
just do player
system.beforeEvents.startup.subscribe(({ customCommandRegistry }) => {
const tp = {
name: "tp:send",
description: "This command can be used to teleport to any player.",
permissionLevel: CommandPermissionLevel.Any,
mandatoryParameters: [
{ type: CustomCommandParamType.PlayerSelector, name: "Player" }
]
}
customCommandRegistry.registerCommand(tp, tpa);
});
function tpa(user, players) {
const player = user?.sourceEntity;
if (players.length > 1) return player.sendMessage(`§cYou can only choose one player.`);
if (player.nameTag !== players[0].nameTag) return player.sendMessage(`§cYou cannot send a teleport request to yourself.`);
for (const allplayer of world.getPlayers()) {
if (allplayer.nameTag == players[0].nameTag) {
tpa_ui(allplayer, player)
}}}
function tpa_ui(player, sender) {
const form = new ActionFormData();
form.title("Teleport Request")
form.body(`hello!!`)
form.button("Yea!");
form.show(player).then((response) => {
})
}
try
const tp = {
name: "tp:send",
description: "This command can be used to teleport to any player.",
permissionLevel: CommandPermissionLevel.Any,
mandatoryParameters: [
{ type: CustomCommandParamType.PlayerSelector, name: "Player" }
]
}
system.run(() => {
customCommandRegistry.registerCommand(tp, tpa);})
});
function tpa(user, players) {
const player = user?.sourceEntity;
if (players.length > 1) return player.sendMessage(`§cYou can only choose one player.`);
if (player.nameTag !== players[0].nameTag) return player.sendMessage(`§cYou cannot send a teleport request to yourself.`);
for (const allplayer of world.getPlayers()) {
if (allplayer.nameTag == players[0].nameTag) {
tpa_ui(allplayer, player)
}}}
function tpa_ui(player, sender) {
const form = new ActionFormData();
form.title("Teleport Request")
form.body(`hello!!`)
form.button("Yea!");
form.show(player).then((response) => {
})
}```
now
done
Neither works
lemme try
İ fixed
const runtp = system.runInterval(()=>{
for (const allplayer of world.getPlayers()) {
if (allplayer.nameTag == players[0].nameTag) {
tpa_ui(allplayer, player)
system.clearRun(runtp);
}}})}
ohhh
yea
sry
my bad
I forgott that u need a action
lol
Np, thanks to your help
https://jaylydev.github.io/scriptapi-docs/features/script-privileges.html#read-only-mode it's this problem again
yea
what thought too
hmm where can I get a deobfuscator to see the scripts in more detail? 😦
btw whats wrong here
what is wrong with```
for (const player of players) { // Line 319
}, (origin, action, players, nicknameRaw) => {
system.run(() => {
for (const player of players) {
if (action === "add") {
if (!nicknameRaw || nicknameRaw.length < 1 || nicknameRaw.length > 20) {
origin.sendMessage(§cInvalid nickname length (1–20 chars));
continue;
}
NicknameManager.setNickname(player, nicknameRaw);
origin.sendMessage(`§aSet nickname of §e${player.name}§a to §e${nicknameRaw}`);
}
else if (action === "remove") {
NicknameManager.setNickname(player, null);
origin.sendMessage(`§aRemoved nickname from §e${player.name}`);
}
else {
origin.sendMessage(`§cInvalid action: use "add" or "remove"`);
}
}
});
});
world.beforeEvents.itemUseOn.subscribe(event => {
// @ts-ignore modified type
if (event.itemStack.typeId == KITS_ITEM) setKit(event.source);
});
world.afterEvents.worldLoad.subscribe(() =>
system.runInterval(() => {
for (const player of world.getPlayers({ tags: [ON_GAME_TAG] })) {
// @ts-ignore type
equipKit(player);
player.removeTag(ON_GAME_TAG);
}
const players = world.getAllPlayers();
}, 1)
);
Can you send me the fix for this script? I'm really bad at scripts. ;-;
I don't know where this will go
if (FormCancelationReason == "UserClosed") {
console.warn("test")
}
İ forget to use it
can you send me a bit more code?
also, FormCancelationReason is an enum
function tpa_ui(player, sender) {
const form = new ActionFormData();
form.title("Teleport Request")
form.body(`hello!!`)
form.button("Yea!!");
form.show(player).then((response) => {
if (FormCancelationReason == "UserClosed") {
console.warn("test")
}
})
}
How do i use this?
function tpa_ui(player, sender) {
const form = new ActionFormData();
form.title("Teleport Request")
form.body(`hello!!`)
form.button("Yea!!");
form.show(player).then((response) => {
if (FormCancelationReason.UserClosed == response.cancelationReason) {
console.warn("test")
}
})
}
Thanks
Is there a quick and easy way to represent players as chest items? For example if I had a chest which has UI options, java has player heads with NBT data, on Bedrock do we have something to show a player or something visually other than just an item name?
not possible
Alr thanks
Oh and does anyone know any good, open source image packs for chest GUI items? Like arrows, back buttons, X, letters and stuff?
I could make my own but if it's not necessary...
maybe you cam find them for on itch.io
game assets section
Alrighty, thanks!
select ui tag
So, not sure if I can get much help to this, but I have this script to spawn potion particles, but im wondering how I can change the color of the potion particle that it spawns
MolangVariableMap
im assuming the particle has variables inside of it, and I believe you can use MolangVariableMap to define the color values.
is there documentation on that?
is there like a roadmap for api changes?
Check the MS Docs.
Theres of course qnas, creator camp, and dev comments.
Documentation for @minecraft/server
Is it already possible to create textures with scripting?
Wait can we use custom commands in beta rn? not preview?
how do i make player visible to itself but not visible to others? just like hive's specator system
yes
Thank you sorry I fell asleep lol meant to reply sooner
to be fair, I took long to respond to you as well
I got busy
I looked in the particle file and I dont think I saw variables for the color actually
it says you can set rgb which I get I can prob match it close enough
but
I dont get it like what confuses me is how to add stuff when ive already got something working
I would just make my own particle
its for 11 items
and he specifically wants the potion particle
which is frustrating
11 textures for different colors
because its the 1 particle in the game you cant just summon easily
there's alot of vanilla particles that are like that.
yeah but bro couldve picked one that we could summon
jsut stumped
Im reading it
its going into my brain
I go to add it
my brain fries
Does anyone know why this would be throwing "Not a function" errors? await world.getDimension("overworld").runCommandAsync(`kick "${target.name}"`);
It's a normal world, but for some reason I just can't run commands
question
will the particle even respond to the set rgb thing
apparently you have to set that in the particle file but thats not data driven I odnt think
it needs to match what you see in the file.
What are you trying here? To fix the errors?
I lied, I see v.color
im trying to make the particle a different color when it spawns
3 am ahh coding session
11:20 pm close enough?
venoct you can do it
hwlp :sobs:
with MolangVariableMap
5am here lol
its possible
"minecraft:particle_appearance_tinting":
{"color":
[
"Math.clamp(2-v.particle_age*4,v.color.r,1)",
"Math.clamp(2-v.particle_age*4,v.color.g,1)",
"Math.clamp(2-v.particle_age*4,v.color.b,1)",
1
]
}}}
tried this but they turned black
there's setType() on the block class.
but also on the dimension class.
dimension.setBlockType()
Documentation for @minecraft/server
um
[Molang][error]-particles/splashpotionspell.json | variable.is_vertical = Math.Random(0.0, 1.0) > 0.7; variable.splash_power = Math.random(0.0, 1.0) * variable.splash_range; variable.color_brightness = 0.75 + Math.random(0.0, 1.0) * 0.25; return 0.0; | Error: unhandled request for unknown variable 'variable.splash_range'
[Molang][error]-particles/splashpotionspell.json | (variable.particle_random_1 * 2 - 1) * variable.splash_power * (variable.is_vertical > 0 ? 0.2 : 0.5) * 2.5 | Error: unhandled request for unknown variable 'variable.splash_power'
[Molang][error]-particles/splashpotionspell.json | (-0.1 * variable.splash_power + 1) * (variable.is_vertical > 0 ? 0.9 : 1.3) * 2.5 | Error: unhandled request for unknown variable 'variable.splash_power'
[Molang][error]-particles/splashpotionspell.json | (variable.particle_random_2 * 2 - 1) * variable.splash_power * (variable.is_vertical > 0 ? 0.2 : 0.5) * 2.5 | Error: unhandled request for unknown variable 'variable.splash_power'
[Molang][error]-particles/splashpotionspell.json | variable.color.r * variable.color_brightness | Error: unhandled request for unknown variable 'variable.color_brightness'
[Molang][error]-particles/splashpotionspell.json | variable.color.g * variable.color_brightness | Error: unhandled request for unknown variable 'variable.color_brightness'
[Molang][error]-particles/splashpotionspell.json | variable.color.b * variable.color_brightness | Error: unhandled request for unknown variable 'variable.color_brightness'
[Molang][error]-particles/splashpotionspell.json | variable.color.a | Error: unhandled request for unknown variable '.a'
Im cooked
just create a custom particle, using the code from the that particle file, remove all the variables, except for the color one
thats what I would do, If I didnt want to deal with this.
yep im just gonna do that
is there documentation on the exact colors for the particles at least?
wdym
you gotta get creative.
well
there's this.
convert the hex to rgb
html :sobs:
np
is it possible to give an item lore when interacting with a block?
yes
playerInteractWithBlock event ig
How to detect if player is in a container opened screen? Like if player is in the screen the shows when the player opens a chest
could do interact with block then check for a container, like chest barrel etc, tho i have no idea how you would do the exit unless you set off a system run interval and look for movement after interact
that way if the player interacts with lets say a chest, we start looking for movement, and then cancel
there is prob a better way
How to close the container screen?
Or the container
i don't think you can, if you want to prevent them from opening it then you can do data.cancel inside a world.beforeEvents.playerInteractWithBlock
Wait, does damaging them by 0 close the container?
maybe not sure
test it!
We I had planned to make the particle today but last night soing some testing I figured out how to do it with the originally vanilla particles partially modified
Can anyone give an example code for custom command in latest stable version? I already tried making it myself but it doesn't work even through it doesn't return an error
show code
system.beforeEvents.startup.subscribe((command) => {
const vhsCommand = {
name: "remove:vhs",
description: "null",
permissionLevel: 0
};
command.customCommandRegistry.registerCommand(vhsCommand,Command);
});
function Command() {
overworld.runCommand("title @a title cd");
}
u using beta apis right
Yep
hmm weird
Docs should have some
I modified the docs one to the above. It doesn't work
It should be working
I think I should create a new world
Ye ig
does ModalFormData textField stops supporitng the 3 options when i want to put values automaticlly inside the textFields?
because now it has just two options
It requires an object with the optional properties for defaultValue and tooltip as you see in that interface.
ModalFormData.textField(label: RawMessage | string, placeholderText: RawMessage | string, textFieldOptions?: ModalFormDataTextFieldOptions): ModalFormData
@wraith charm u should not be selling things coded by me, to other people which dont even work anymore bud
wasnt scamming me off enough u blocked me too?
(i had to send msgs here, apologies for any inconveniences)
What will happen if use unloaded entity id for world.getEntity()
Will fail to return the object.
could you give me and exampl?
or wait i think i got it
world.beforeEvents.worldInitialize.subscribe(initEvent => {
initEvent.blockComponentRegistry.registerCustomComponent("eidolon:altar_destroy", {
onPlayerDestroy(eventData) {
const block = eventData.block;
const dimension = block.dimension;
const { x, y, z } = block.location;
const dir = [
{ x: 0, z: -1 }, // north
{ x: 0, z: 1 }, // south
{ x: 1, z: 0 }, // east
{ x: -1, z: 0 }, // west
{ x: 1, z: -1 }, // northeast
{ x: 1, z: 1 }, // southeast
{ x: -1, z: -1 },// northwest
{ x: -1, z: 1 } // southwest
];
for (const direction of dir) {
const neighborLocation = {
x: x + direction.x,
y: y,
z: z + direction.z
};
const permutation = blockAround.permutation;
if (permutation) {
const updatedPermutation = permutation.withState('eidolon:update', true);
blockAround.setPermutation(updatedPermutation);
}
}
}
}
});
});
Does anyone know why it only runs on the first coordinate in dir?
blockAround is not declared so it's failing due to it being undefined. When it fails it will stop iterating through the array.
I forgot to change it, I changed it to neighborLocation and it still doesn't work.
Can you access minecraft:cursor_inventory while the player is not in a UI? I know it sounds like a dumb question but there's a duplication glitch where you load into the world and you have the duplicated item in your cursor
I'm struggling to even access the inventory on join now...
That's because neighborLocation is simply an object containing the properties x, y, and z and does not have the property for permutation. So it's failing. If you want the permutation then you need to get the block based on the location you are targeting first.
Documentation for @minecraft/server
What version for Minecraft and Minecraft-ui are we?
you mean server
1.19.0 and 2.0.0-beta for server
1.3.0 and 2.0.0-beta for server-ui
Ain’t we on like 2.0.1 for server?!
Or something like that
how to make player teleport to dimension overworld location only?
why is the EntityTameableComponent invalid when iterating through entities?
#1313403937268830218 message
source would be replaced with your player reference
Use search to find answers
Most questions have already been answered in here.
hmm, detecting the world difficulty isn't stable yet?
It should be.
vanilla mobs remove the component on tame....
there is a bug report for that
umm, in a stable update or in a beta/preview update?
stable in stable
bruh...
good, so i can make the next hydration update.
1.19.0 or something?
that was my reaction too
yes
good.
Is it a bug if naming a container entity you are viewing gets renamed, the title at the top doesn't change. Like for example a chest boat, if someone renames it while you are viewing the chest, the text at the top doesn't change.
guys how can I use entity.tryTeleport(location, {dimension})?
cuz when I tried doing something like
player.tryTeleport(location, {dimension: "minecraft:overworkd"})
error occured
maybe it shouldn't be dimension id?
what error
pass the object ie player.dimension
well I am using type id to possibly save the data that could be use anywhere. But I guess I found out how to fix it by
const dataDimension = world.getDimension(data.dimension)
player.tryTeleport(vec3, {dimension: dataDimension})
thanks anyway
well I am using type id to possibly save the data that could be use anywhere. But I guess I found out how to fix it by
player.tryTeleport(vec3, {dimension: player.dimension})
u need this
there's a reason why I am using dimension id. I could just use just the vector3 if I want it in the same dimension.
the data in my code is related to my database
Congratulations, you're the 200th "100K message!!!!"
wooohoo 🥳 🎉
umm, what extension do i need to install?
blockception adds intellisense if that what you mean
i already have installed it
the npm
npm install ... command
Installation for @minecraft/server
Latest API module install:
npm i @minecraft/[email protected]
Beta API module install:
npm i @minecraft/[email protected]
Preview API module install:
npm i @minecraft/[email protected]
Preview Beta API module install:
npm i @minecraft/[email protected]
Why is this not updated
npm i
or
npm i --legacy-peer-deps
if you have a project setup and depending on what setup
find the latest here
Is there a way to detect if a player has joined recently without saving their id or gamertag in the database
just detect when they join store dynamic value of the time maybe
then recieve dynamic value and test on it to see if recent
well, rip
umm, how am i going to run that command?
In your terminal
it's in docs...
Tough
you said not saving in database this is just saved to the player as a dynamic value no database needed
-# i am completely lost here.
Are you on PC?
behavior are the same thing
yes.
win+R?
Win+R then press cmd
Press the Windows key + r. In the Run box, type cmd, and then click Ok. This opens the Command Prompt window.
what code editor/ide you using
vscode
like so?
then you can open console with ctrl+~
and,
did the black box come up
it did
run the npm command
sure
are you starting a new project if so id do it the microsoft recomended way using mctools and create a npm project
Minecraft Creator Tools
just use addon starter or typescript starter and save to folder on your computer, open in vscode, open console and type npm i
ummm, i cant use the command there, so how am i going to install it from the docs?
(i need the docs link)
you use it to give you a template i was suggesting may be easier for you
You don't even use that
you can and its what minecraft devs use alot and is through out microsofts documentation, then the install process and starting would be easier
-# im on a laptop btw
Ah
you need to install npm
mhm
make tutorials on installing node.js @granite badger
😅 think there are alot out there
youtube exists
also the beginners guide on Microsoft website about addon dev goes through it
i just need to run those after i install the node.js thing?
you run the installer then yes, you run the npm command
Windows Installer (.msi)
cuz i have no clue what winget is
installing
i would recommend going to the wiki and understanding the basics this will teach you alot of this https://wiki.bedrock.dev/
why js runCommandAsync in 2.0.0-beta is not working ?
i believe that was marked for deprecation in microsoft's docs...
it does not exist in 2.0.0 anymore
use runCommand
replace in VS Code
Ctrl + Shift + F
runCommandAsync -> runCommand
Hello people I just wasted an entire day just creating a inefficient maze generator, who wants to judge it?
has somebody tried making one here?
nope but dungeons yep
dunno man
they use jigsaw block
and I refuse to use it cause I can't debug structure
I haven't figured out how to create a structure and manually generating them for debug
so I made my own maze generator
dang......
now I need to get the orientation of each cell and correspond it to each of my structure
Im halfwaythrough
dayummm
I know there is a quicker way than this but damn
How do I find out which script caused this? It's on a realm, first time happening
Hmm
Any script storing information in memory but not cleaning it up when needed. Could be a Map, Set, Array, growing object cache, or even leftover event listeners that never get disposed of. Anything that keeps expanding each tick without being cleared will eventually exceed the heap limits and crash the server. So look at your scripts and evaluate what is accumulating memory and not keeping it under control.
Alrighty, thanks!
setRotation works on the player?
detecting the potion type is still on beta, right?
yes i believe,
no
F
setRotation is weird anyway
how can I move the player camera manually?
maybe thats why its weird when I use it
ive been setting the either the body rotation or head rotation to 0
I think
i think by using setRotation to rotate the player head,
like I just said
you cant.
mhm,
but setRotation doesnt work on players (?
the method does not support players.
???
he is so shocked that he transformed into a villager now
huh
hrmm, then why player.setRotation is available?
because a player is an entity.
then u have to use teleports to rotate the player head
applyImpulse too
ya i see,
its too glitchy tho
then you have no other option.
especially while falling or keep rotating the player head
you cant move with that
exactly
you also can't use keepVelocity for players in teleportOptions.
the only good option is:
-# telling the player to rotate his head for u, Please turn your head 36° horizontally

Because Mojang came up with some weird system with player movements. Although if you sit in a minecart and apply an impulse to it, everything will work great.
It's like they don't add support for Player for fun
rotating the minecart will not rotate the player head i believe
Me when I don't understand server/client communication.
in minecraft yeah.. its weird how the game works
how opening the inventory is server side? 
i think it doesn't supports the player bec it will move the player entity without moving the screen, just like having the player entity separated from the screen, or rotating the player head without rotating the screen with it so everything will be glitched,
i think thats the main reason why it doesn't supports the player.
Seems logical to me since the data is stored on the host running the world and not on the client joining the world.
everything is server-side nowadays, even profanity
not in java edition
I played in a server with 300ms and opening the inventory is instantaneous
even the movement is server authoritative
I'm not familiar with Java but if the data is stored on the client and not the host (server) then to me that sounds like a security vulnerability for hackers.
being server side doesnt stop hackers too
Ask how it's working out for them with the inventory now lol.
and also, I dont know how it works but some clients can make the inventory client side
Not on Bedrock. Doesn't work that way.
idk, Im not hacker lol
try Flarial client
yes, its on bedrock
You ain't modifying the inventory on a Realm or Server. Only local. I already know.
I tried and it works on servers
Local doesnt make sense, you have 0 ping
Lies
Can the dependent resource pack be in development_resource_packs?
{
"format_version": 2,
"header": {
"name": "XenonShield UI",
"description": "Custom UI icons for XenonShield",
"uuid": "ac64910d-6f1f-42da-8ea3-c7e252cc7e8e",
"version": [1, 0, 0]
},
"modules": [
{
"type": "resources",
"uuid": "5646be74-54d4-4e99-9998-79ece117dcc9",
"version": [1, 0, 0]
}
],
"dependencies": [
{
"uuid": "4cde7ab3-ed56-46dc-b788-8ef59a32bc30",
"version": [1, 0, 0]
}
]
}
Manifest for the RP
It's inside the development resource packs
is it only my device or playerButtonInput is bugged when a mobile device player (at least android in my case) presses sneak button? It always fire as "released" state.
The packet required to modify the inventory was patched a couple of years ago and another solution or workaround hasn't been found since then. If you try it, it gets ignored.
So unless you are doing something on a server not Bedrock then I'm not convinced by your claims.
additional info: An exception was made if you're the host in a singleplayer world iirc
Yea, I mentioned that when I said local earlier.
Which makes sense because you are on the same system that is hosting.
Don't need to. Their project is open source. I can look at the code.
well why it works on servers then?
That's the problem. It doesn't. Not sure why you are still pushing this.
Yea, except I don't see anywhere in their code where you could have "tried".
Would you like me to send you the link to their repo so you can show me where it's possible and prove me wrong?
It's written in C++.
is there a way to detect how many custom items there are outside of vanilla?
from in game?
what addons add?
yeah
oh bet
give me a sec
legend thanks
ItemTypes.getAll()
and count them by namespace
heck yeah... thanks let me give that a go!
didn't think about that honestly
just need to make sure the herobrine setup is automatic so the icons show properly automatically
as i've had it manually counted and then set
for a long time
doesn't that need file editing?
nah, i've made it work ingame config lol
just so people could update if they added other addons
with new items
ah, that is cool
yeah, this is what i am using
i just wanted to stop guessing
lol
as i have minecraft addons that are from the store
i can't look at their files
works great thank you, im able to auto get the number value
no more manual
Oh item textures don't support Alpha?
How to spawn a specific potion item?
no unless its an attachable
import { world, ItemStack } from '@minecraft/server';
const dimension = world.getDimension("overworld")
const potion = ItemStack.createPotion({effect: "Healing", liquid: "Regular", modifier: "Long"})
dimension.spawnItem(potion, {x: 0, y:0, z:0})
world.afterEvents.playerBreakBlock.subscribe((ev) => {
const player = ev.player;
const item = ev.itemStackAfterBreak;
const durability = item.getComponent("minecraft:durability");
if (durability)
durability.damageItem(1)
help why is this not damaging it
Ah alr ty!
Is there a way to add enchantment gleam to custom items without them having the enchantment name?
yes
its a component
look for something with the word glint in it
I did have this which is what I thought it was. Can't see anything in the docs
Ah
Thanks!
ggs
could anyone help?
you have to set the item again
Hmmm no change
so, get the item, change it damage and set the item again
wym?
what?????????
Nothing is shown, do I need anything extra?
am i not able to just apply damage to it
yes just set the item again
get the player mainhand and set the itemstack again
wth
What is the thing to do Player Interact With Block
?/
entity.setViewRotation() when?
Hi
you have to update the item by setting it in players hand so new Damaged item overrides the oldDamaged item. get player's equippable component the component.setEquipment("Mainhand", item);
#1366480200589770924 someone have some time to fix this dev resource?
Custom or vanilla block?
Custom but it is to get the owner of a block
You can put "tag:<yourtag>":{} in components section of the block json file
I don't think you can do a dynamic tag like that unless you use scripting
Im making a gens thing
Gens thing?
I've seen people make custom UIs that look very different than ActionFormData or ModelFormData. How is that achieved? i cant find info about it on the wiki. is it experimental stuff?
json ui
it's deprecated and ore ui is in development (ig)
so it'll likely arrive in 3-5 business days
ah. And with that we can make custom looking uis for our blocks and entities right? not just alter how vanilla stuff looks
you can modify vanilla ui not create custom ones
and there are alot of limitations
even when paired with action form data and such? oh well
you should check it on Bedrock.dev and Bedrock wiki
-# this should be unpinned
How to TP each player with the same tag to a different location like random spawns but one person at each location?
Why?
feel no longer relevant/needed
does anyone know how to decrypt code
one of my friends found a gun pack and it has built-in death messages that are encrypted and I'm trying to remove it for them since I made custom death messages already
We dont support that here.

you cant just ask the developer to make it toggle-able
better than being scummy
What's wrong with editing addons?
think for a second
I've been thinking about this for over a decade.
oh yeah I'm going to distribute it to everyone totally
Just look up a JS deobfuscator and fix it.
okay thank you
I think it's so weird how the Bedrock community gets so upset about people looking through their packs. People don't behave like that in the Java community.
I don't find it weird at all.
I've literally found out an addon was malicious after looking through it.
People tend to adopt the practice of the professionals in any given field.
What if the professionals are in the wrong.
Then someone has to refute it and then they become professionals.
We need more Java creators to invade this space. 
But in Bedrock's case, these professionals(Marketplace) are heavily isolated of each other and have encryption which influences us hobbyists.
Please.
Sorry for making this chat go off topic though. This is just something that bothers me about this community.
honestly, its fine, im now rethinking things.
It's definitely problematic if the modified pack is distributed. I'd at least ask for permission.
yeah but looking at code to try to understand and learn
I just think people are just worried about their addons being stolen
If one were to steal an addon, they'd just upload the zip file with no modifications. They don't care what's in it.
i can confirm this 😭
there are so many websites that reupload my stuff
it can also be people just wanting to gatekeep things.
It's pretty bad on the Java side too. 😅
I've dealt with people like that when someone asks a question. They get so mad when you describe the technique (even if it's something basic).
Java isn't immune from those people too. 😅
