#Script API General

1 messages · Page 82 of 1

round bone
#

😅

thorn flicker
#

its fine

distant gulch
#

why was isOp removed

#

and is there an alternative without using tags

wary edge
distant gulch
#

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

tight bloom
#

Done, sorry for clogging the channel

distant tulip
distant gulch
#

oh okay

#

thank you

#

im guessing thats preview only

#

i dont see that in the base game

#

well that sucks

thorn flicker
#

2.1.0-beta

distant gulch
#

at this point i may as well make realms and serves in preview and force anyone who actually wants to play to download preview 😭

remote oyster
# distant gulch i dont see that in the base game

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.

distant tulip
#

anyone here good with math?

distant gulch
#

depends is the math 2+2?

distant tulip
#

dot product related

valid ice
#

What’s up

full idol
#

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...

▶ Play video
distant tulip
# valid ice What’s up

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

valid ice
#

Movement vector is relative to player… how?

valid ice
full idol
full idol
valid ice
#

Not the block, no

#

My bad, thought you meant the inventory crafting grid

distant tulip
full idol
#

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?

distant tulip
full idol
#

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

valid ice
#

Idk what movement vector returns- is it like, x=1 for forward or what

distant tulip
#

just added signed angle to my angle function and that fixed it

#

-# thanks for considering helping me herobrine

valid ice
#

Ah lol

#

No worries, I guess?

somber cedar
#

I can't get it to work

distant tulip
# valid ice No worries, I guess?

~~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

distant tulip
valid ice
distant tulip
#

alr, lol

somber cedar
#
const vec = player.inputInfo.getMovementVector();
if (vec.x === 1) {
    console.log('left')
}
#

it's not printing the text when im moving left

valid ice
#

Log vec and see what it is returning

somber cedar
#

0.7415120...

valid ice
#

That sure ain’t equal to 1 😛

distant tulip
#

there is diagonal movement too

#

does the value change depending on the device? there is a bit of offset

somber cedar
#

for me it's giving between 0.5 to like 1

distant tulip
#

huh

#

that is way off

somber cedar
#

I fixed it

idle oar
#

Is it possible with script to fade in a night skybox with time of day?

somber cedar
#

What does this do because it works

unique acorn
wary edge
#

This is the code I used without using the as any

valid ice
echo tinsel
#

Would I ask here if I need help setting up a UI config for drop rates ?

remote oyster
# echo tinsel 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.

echo tinsel
#

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

distant tulip
#

What are you trying to do

echo tinsel
#

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?

patent tapir
#

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

distant tulip
#

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})
echo tinsel
distant tulip
#

Didn't understand some parts, you want to hide some options conditionally?

fallow minnow
#

Why can't bds grab xuid

echo tinsel
#

and it actually requires modalform? which i can not wrap my head around how it works

fallow minnow
#

const form = new ModalFormData()
form.title
form.dropdown
form.textfield
form.toggle
form.whatever else

echo tinsel
#

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

cold grove
true isle
#

am i the only one that cant get their pack out of 1.21.50?

true isle
#

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

wary edge
#

Haven't had this issue.

#

But it's also a vague issue.

true isle
#

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

fallow carbon
#

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">(...)

halcyon phoenix
#

what does server ui do?

#

what are some stuff that you can do with it?

remote oyster
rigid torrent
#

How can I add lore to crafted items without any ticking?

rigid torrent
shy leaf
rigid torrent
#

I don't think line breaks work on lang files

shy leaf
#

yes but in the behavior pack, however...

rigid torrent
#

But I do remember there was a way to add them, that's what im asking

shy leaf
#

this is what better on bedrock did

rigid torrent
#

bad method

#

will be the same name in any language

shy leaf
#

yeah but what else do we have here

#

wait wha

rigid torrent
#

What im asking

wary edge
#

What are you talking about? Those will be translated.

rigid torrent
#

Will that not be the same in all languages like display method used to work

shy leaf
#

no its properly translated

#

i can confirm it

rigid torrent
#

okay

#

thanks

wary edge
#

Display method has always supported translations.

rigid torrent
#

I remember hearing it didnt

#

Anyway thanks!

remote oyster
# rigid torrent How can I add lore to crafted items without any ticking?

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 👀

shy leaf
#

crafted items trigger WHAT

remote oyster
#

I could be wrong.

shy leaf
#

omw to test

true isle
#

so i completly forgot about the crafting_item_catalog.......

shy leaf
#

if this works its gonna be a godsend

#

(janky one but yeah)

wary edge
#

You could actually probably detect inventory change now.

remote oyster
#

That too

#

That may be the better option I think lol.

wary edge
#

But thats not foolproof.

shy leaf
remote oyster
#

If anyone tests entitySpawn, report back lol.

shy leaf
#

im doing it rn

wary edge
shy leaf
#

i shouldve specified... i meant like grabbing the item in inventory with mouse

wary edge
#

Well, you jusy have to wait for the crafted item detection event MOjang is planning.

remote oyster
shy leaf
#

yeah

halcyon phoenix
shy leaf
#

...no

halcyon phoenix
#

wait no json ui involvement?

shy leaf
#

yeah

#

no

#

its all from native method

halcyon phoenix
#

ohhh

#

also is there any example file for fogs? i can't find the vanilla ones

shy leaf
halcyon phoenix
#

I found it nevermindd

halcyon phoenix
#

yeah i just found it there was many options

shy leaf
#

oh i forgot the existence of bedrock samples

halcyon phoenix
remote oyster
halcyon phoenix
#

thanks

#

when I modify the resource pack / fog.json I need to reopen the world, is there any other way?

shell sigil
#

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

halcyon phoenix
halcyon phoenix
little hull
#

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?

prisma shard
#

Crafted items trigger entiitySpawn?

distant tulip
#

No

prisma shard
shy leaf
#

it doesnt work

prisma shard
#

ah

#

okay

little hull
#
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?

prisma shard
oak lynx
prisma shard
deep quiver
prisma shard
oak lynx
#

more readable i guess

deep quiver
oak lynx
#

it defaults to 1 iirc

deep quiver
#

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

oak lynx
#

i havent noticed a difference going from 1.0.0 to 2.0.0

deep quiver
#

Try it out

little hull
oak lynx
#

wait is bds 1.21.80 compatible with 1.21.81

deep quiver
#

Wdym compatible?

oak lynx
#

can a player on 1.21.81 play on 1.21.80 bds

deep quiver
#

What kind of update was it?

#

For hotfixes its usually fine

#

Ah yeah it was

#

Should work yeah

oak lynx
#

but it changed behavior packs slightly

#

i am too lazy to try

#

nvm i will try

deep quiver
#

Yeah I saw that

oak lynx
#

it works 🙏

wintry bane
#

How do I trigger an event when the player is sneaking/jumping. Does it have something to do with the inputButton enum?

wintry bane
#

Can you show examples, I can't find it in docs

little hull
little hull
ivory bough
#

What is the new permission system?

unique acorn
round bone
distant gulch
#

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

ivory bough
unique acorn
# ivory bough 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

ruby haven
#

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?

ivory carbon
#

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

wary edge
little hull
#
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",
            });
        }
    }
});```
little hull
echo tinsel
final ocean
#

All types of Minecraft modules

warped blaze
#

does saving dynamic properties on an entity prevents it from depawning?

#

or does it despawn as usual

remote oyster
little hull
#

how can is sync a riders bone rotation and position to the ride through combination of scripts and molang

midnight ridge
#

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]
            );
          }```
echo tinsel
#

Is it possible to make an actionform button open a modalform ui?

remote oyster
#

Yes

echo tinsel
#

How does one do that?

remote oyster
# echo tinsel 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.

echo tinsel
#

Thank you

grand heart
#

why can't i edit skin id and mark variant anymore using scripting? why did they change it to read only?

grand heart
#

"geometry": "Array.geos[query.mark_variant]",
"materials": [ { "*": "Material.default" } ],
"textures": [ "Array.skins[query.skin_id]" ]

open urchin
#

use entity properties

wary edge
# grand heart and scale

Devs said there was issues that couldn't be ironed out so they made it readonly. Or something like that.

grand heart
#

so i can dynamically change skins

#

ahh

#

okay

grand heart
open urchin
#

yes

grand heart
open urchin
#

query.property('my:property')

grand heart
#

thank youu, also can i change the entity scale using render controllers?

open urchin
#

just the visual size? not collision box

grand heart
#

yes sir

#

it's actually better for me

open urchin
#

in the client entity file there's a scale parameter in scripts

"scripts": {
  "scale": "molang"
}
frozen vine
#

Is it possible for me to change the state of my block when hit by a wind charge like it happens with vanilla doors?

open urchin
#

you can subscribe to the projectilehitblock event

echo tinsel
#

How can I detect when a player has picked up a custom item?

wary edge
echo tinsel
#

How does something like jaylys statistics detect items have been picked up if it requires a 1.21.90 thing?

remote oyster
full idol
#

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?

sharp elbow
#

Not reliably. My guess is you should repeatedly try showing the form until they see it.

thorn flicker
#

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.

full idol
#

Ah yeah thanks, just saw this

fallow rivet
#
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?

open urchin
#

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}`);
  }
}
full idol
#

@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!

valid ice
#

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

full idol
# valid ice Right now? No

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...

▶ Play video
valid ice
#

If you're worried about things breaking when ore-UI releases, that method would also break

full idol
valid ice
#

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

full idol
#

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!

valid ice
#

👍

full idol
#

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!

gilded shadow
#

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

full idol
#

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

wary edge
full idol
#

Ah right, thanks

frozen vine
steady canopy
wary edge
thorn flicker
wary edge
prisma shard
#

i badly need this event ngl

shy leaf
#

does causing iframes and knockback but dealing no damage trigger entityHealthChanged event?

olive rapids
#

Someone here knows if it's possible to make blocks like gravel, sand, stay floating, like common blocks?

past coyote
#

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

halcyon phoenix
#

when I spawn a structure it always spawns in a corner is it possible to manipulate that?

leaden elbow
#

how do i get itemstack name nametag doesnt work

echo tinsel
#

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

silver agate
#

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

leaden elbow
#

how to get item name

leaden elbow
#

i mean how can i translate localization key in some string variable? like for example console.warn(item.localizationKey)

shy leaf
#

but you can use sendMessage() method instead

shy leaf
#

i was looking for that one but it wasnt there so i thought i was crazy

halcyon phoenix
#

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?

random flint
halcyon phoenix
leaden elbow
leaden elbow
#

yeah i use that

gaunt salmonBOT
shy leaf
#

theres #debug-playground for this

halcyon phoenix
random flint
#

Prefix doesn't get carried when exported

#

The prefix changes into what folder name the mcstructure put in.

halcyon phoenix
#

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

worn palm
#
world.beforeEvents.chatSend.subscribe(ev=>{})

why does this doesn't work on serve

random flint
#

Have you toggled Beta-API?

worn palm
#

Yeah

#

but it's not detecting the msg

#

I'm using a fakeplayer addon

random flint
#

Does it work in the first place? On the local world?

worn palm
#

yeah it works

#

but if i put it on aternos it doesn't

random flint
random flint
worn palm
#

but is there any other way to force load chunk using scripts?

random flint
#

Here's someone who already did it on script resource: #1364195448017125406 message

echo tinsel
#

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?

granite cape
#

i dont wanna leave this playground, but my phone make me difficulty for modified the scripts

#

this will be insane

woven loom
#

what do you mean

leaden elbow
#

so theres no way i can use localizationKey for my strings?

fallow rivet
#
        permissionLevel: CommandPermissionLevel.GameDirectors,
fallow rivet
distant tulip
#

Any?

leaden elbow
#

like to use item.localizationKey in my console.warn or sum

#

and not on sendMessage

fallow rivet
# distant tulip Any?

This command can only be used by people who are operators, I want all players to use it.

distant tulip
#

CommandPermissionLevel.Any

fallow rivet
#

It's amazing how simple it is

round bone
#

😉

fallow rivet
round bone
#

not offensive, but can save a lot of time

fallow rivet
#

I want to show all players names here but without @a,@e,@p

round bone
fallow rivet
#

😦

remote oyster
# fallow rivet 😦

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.

round bone
#

he can check if there's more than 1 player

#
if (argName.length > 1) return
const selectedPlayer = argName[0]
fallow rivet
#

Hmm

#

Ok

remote oyster
#

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.

olive rapids
#

Does anyone know how I can fix this? Please help me :((

#

"2.0.0"

fathom hemlock
#

what scriptapi version?

olive rapids
# fathom hemlock 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"
}
]
}

fathom hemlock
olive rapids
#

can you fix it please?

fathom hemlock
#

{
"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

olive rapids
#

ok

#

im going to test

fathom hemlock
#

rejoin ur world

olive rapids
#

ok

#

...

#

hmm

fathom hemlock
#

ssw1.js

#

line 1

gaunt salmonBOT
# olive rapids

Debug result for [code](#1067535608660107284 message)

Compiler Result

Compiler found 2 errors:

rank.js:52:16 - error TS2339: Property 'nameMsg' does not exist on type 'Player'.

52         player.nameMsg = playerConfigRank.namefront + player.name + playerConfigRank.namebehind;
                  ~~~~~~~

``````ansi
rank.js:56:20 - error TS2339: Property 'chatSend' does not exist on type 'WorldBeforeEvents'.

56 world.beforeEvents.chatSend.subscribe((chat) => {
                      ~~~~~~~~

Lint Result

There are no errors from ESLint.

olive rapids
olive rapids
#

.

fathom hemlock
#

worldInitialize is now worldload

olive rapids
#

send me please

fathom hemlock
#

brooo its encrypted

olive rapids
#

ooh nooo

#

wait

fathom hemlock
#

and just do it urself

#

cuz u want to learn smth

#

not me

somber cedar
olive rapids
#

oh

#

..

#

how to decrypt?

fathom hemlock
#

why did u encrypt it?

gaunt salmonBOT
# olive rapids
Debug Result

There are 11 errors from compiler, and 0 errors from ESLint in this [code](#1067535608660107284 message).
Please read the attached file for the result.

olive rapids
# fathom hemlock why did u encrypt it?

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.

fallow rivet
#
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?

fathom hemlock
#

ohhh

#

wait

#

give me the command code

#

the error is in the custom command

fathom hemlock
#

wait

#

no ur code

#

ur tpa command code

fallow rivet
#
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) => {
})
}
fathom hemlock
#

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

fallow rivet
#

Neither works

fathom hemlock
fathom hemlock
#

again

fallow rivet
#
const runtp = system.runInterval(()=>{
for (const allplayer of world.getPlayers()) {
if (allplayer.nameTag == players[0].nameTag) {
tpa_ui(allplayer, player)
system.clearRun(runtp);
}}})}
fathom hemlock
#

yea

#

sry

#

my bad

#

I forgott that u need a action

#

lol

fallow rivet
#

Np, thanks to your help

somber cedar
olive rapids
#

hmm where can I get a deobfuscator to see the scripts in more detail? 😦

olive rapids
#

Decrypt

fathom hemlock
#

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"`);
                    }
                }
            });
        });
olive rapids
fathom hemlock
#

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)
);

olive rapids
# olive rapids .

Can you send me the fix for this script? I'm really bad at scripts. ;-;

olive rapids
fathom hemlock
fallow rivet
#
if (FormCancelationReason == "UserClosed") {
console.warn("test")
}

İ forget to use it

round bone
#

also, FormCancelationReason is an enum

fallow rivet
#
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")
}
})
}
fallow rivet
round bone
#
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")
        }
    })
}
full idol
#

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?

full idol
#

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...

gilded shadow
#

game assets section

full idol
#

Alrighty, thanks!

gilded shadow
#

select ui tag

hazy copper
#

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

thorn flicker
#

im assuming the particle has variables inside of it, and I believe you can use MolangVariableMap to define the color values.

hazy copper
#

is there documentation on that?

oak lynx
#

is there like a roadmap for api changes?

wary edge
#

Theres of course qnas, creator camp, and dev comments.

umbral dune
#

Is it already possible to create textures with scripting?

hollow cave
#

Wait can we use custom commands in beta rn? not preview?

leaden elbow
#

how do i make player visible to itself but not visible to others? just like hive's specator system

hazy copper
thorn flicker
hazy copper
#

Yeah but in your defense I didn't ping you in my reply first time

#

🙏

thorn flicker
#

oh no

#

I saw you asking

#

lol

hazy copper
#

😭

#

im still lost tbh

thorn flicker
#

I got busy

thorn flicker
hazy copper
#

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

thorn flicker
#

I would just make my own particle

hazy copper
#

its for 11 items

#

and he specifically wants the potion particle

#

which is frustrating

thorn flicker
#

11 textures for different colors

hazy copper
#

because its the 1 particle in the game you cant just summon easily

thorn flicker
#

there's alot of vanilla particles that are like that.

hazy copper
#

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

full idol
#

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

hazy copper
#

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

thorn flicker
hazy copper
#

bro im failing miserably

#

please im too stupid 😭

full idol
hazy copper
#

im trying to make the particle a different color when it spawns

stuck ibex
hazy copper
thorn flicker
#

venoct you can do it

hazy copper
#

hwlp :sobs:

thorn flicker
#

with MolangVariableMap

full idol
thorn flicker
#

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
]
}}}
hazy copper
halcyon phoenix
#

what's the method for placing a block in script?

#

I forgor

thorn flicker
#

there's setType() on the block class.

#

but also on the dimension class.

#

dimension.setBlockType()

halcyon phoenix
#

yhanks

#

thanks

hazy copper
#

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

thorn flicker
#

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.

hazy copper
#

yep im just gonna do that

#

is there documentation on the exact colors for the particles at least?

thorn flicker
#

wdym

hazy copper
#

the potion particles

#

what colors they are

thorn flicker
#

an exact doc for that

#

probably not

hazy copper
#

wah

#

alright

thorn flicker
#

you gotta get creative.

hazy copper
#

he wants exact colors

#

welp

#

time for some dream tryharding

thorn flicker
#

well

#

there's this.

hazy copper
#

YO

#

good enough

thorn flicker
#

convert the hex to rgb

hazy copper
#

thank you

#

yep I know how

thorn flicker
#

oh

#

alr

hazy copper
#

html :sobs:

thorn flicker
echo tinsel
#

is it possible to give an item lore when interacting with a block?

gilded shadow
#

playerInteractWithBlock event ig

ivory bough
#

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

hollow cave
#

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

ivory bough
#

Or the container

hollow cave
ivory bough
hollow cave
#

test it!

hazy copper
# thorn flicker np

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

ivory bough
#

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

woven loom
#

show code

ivory bough
# woven loom 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");
}

woven loom
#

u using beta apis right

ivory bough
woven loom
#

hmm weird

ivory bough
woven loom
#

It should be working

ivory bough
woven loom
#

Ye ig

midnight ridge
#

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

remote oyster
#
ModalFormData.textField(label: RawMessage | string, placeholderText: RawMessage | string, textFieldOptions?: ModalFormDataTextFieldOptions): ModalFormData
stark kestrel
#

@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)

harsh hare
#

What will happen if use unloaded entity id for world.getEntity()

remote oyster
midnight ridge
#

or wait i think i got it

nocturne berry
#
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?

remote oyster
nocturne berry
full idol
#

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

full idol
#

I'm struggling to even access the inventory on join now...

remote oyster
native patio
#

What version for Minecraft and Minecraft-ui are we?

thorn flicker
native patio
#

XD

thorn flicker
#

1.19.0 and 2.0.0-beta for server
1.3.0 and 2.0.0-beta for server-ui

native patio
#

Or something like that

thorn flicker
#

2.1.0-beta (server and server-ui)

#

but thats preview.

leaden elbow
#

how to make player teleport to dimension overworld location only?

drowsy scaffold
#

why is the EntityTameableComponent invalid when iterating through entities?

mighty igloo
#

source would be replaced with your player reference

#

Use search to find answers

#

Most questions have already been answered in here.

untold magnet
#

hmm, detecting the world difficulty isn't stable yet?

wary edge
distant tulip
untold magnet
distant tulip
#

stable in stable

untold magnet
#

good, so i can make the next hydration update.

untold magnet
distant tulip
distant tulip
untold magnet
#

good.

full idol
#

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.

fallow minnow
#

No

#

Just re open the menu

copper egret
#

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?

woven loom
#

what error

copper egret
woven loom
#

pass the object ie player.dimension

copper egret
#

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

woven loom
#

u need this

copper egret
#

the data in my code is related to my database

slow walrus
#

successfully mitigated

warm mason
slow walrus
#

wooohoo 🥳 🎉

untold magnet
inland oracle
untold magnet
inland oracle
somber cedar
#

npm install ... command

gaunt salmonBOT
somber cedar
#

Why is this not updated

inland oracle
#
npm i

or

npm i --legacy-peer-deps

if you have a project setup and depending on what setup

untold magnet
inland oracle
copper egret
#

Is there a way to detect if a player has joined recently without saving their id or gamertag in the database

somber cedar
#

no

#

minecraft doesn't even do that themselves

inland oracle
#

just detect when they join store dynamic value of the time maybe

copper egret
inland oracle
#

then recieve dynamic value and test on it to see if recent

copper egret
untold magnet
somber cedar
#

Dunno if this stats mod do anything

somber cedar
#

it's in docs...

copper egret
#

I said no saving datas

somber cedar
#

Tough

inland oracle
#

you said not saving in database this is just saved to the player as a dynamic value no database needed

untold magnet
somber cedar
#

Are you on PC?

copper egret
#

behavior are the same thing

untold magnet
somber cedar
#

open up command line

#

Then run npm install command

untold magnet
somber cedar
#

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.

inland oracle
#

what code editor/ide you using

somber cedar
#

vscode

untold magnet
#

like so?

somber cedar
#

No

#

Type cmd

inland oracle
#

then you can open console with ctrl+~

somber cedar
#

Open: cmd

#

then press ok

untold magnet
#

and,

somber cedar
#

did the black box come up

untold magnet
#

it did

somber cedar
#

run the npm command

untold magnet
#

sure

inland oracle
#

are you starting a new project if so id do it the microsoft recomended way using mctools and create a npm project

#

just use addon starter or typescript starter and save to folder on your computer, open in vscode, open console and type npm i

untold magnet
#

(i need the docs link)

somber cedar
inland oracle
#

you use it to give you a template i was suggesting may be easier for you

somber cedar
#

You don't even use that

inland oracle
#

you can and its what minecraft devs use alot and is through out microsofts documentation, then the install process and starting would be easier

somber cedar
#

Ah

inland oracle
#

you need to install npm

untold magnet
#

mhm

somber cedar
#

make tutorials on installing node.js @granite badger

inland oracle
#

😅 think there are alot out there

warm mason
inland oracle
#

also the beginners guide on Microsoft website about addon dev goes through it

untold magnet
somber cedar
#

you run the installer then yes, you run the npm command

#

Windows Installer (.msi)

#

cuz i have no clue what winget is

untold magnet
inland oracle
#

i would recommend going to the wiki and understanding the basics this will teach you alot of this https://wiki.bedrock.dev/

hoary matrix
#

why js runCommandAsync in 2.0.0-beta is not working ?

jagged jewel
#

i believe that was marked for deprecation in microsoft's docs...

somber cedar
round bone
#

use runCommand

#

replace in VS Code

#

Ctrl + Shift + F

#

runCommandAsync -> runCommand

hoary matrix
#

runCommand is also not working

#

i tried

#

like sender.runCommand

halcyon phoenix
#

Hello people I just wasted an entire day just creating a inefficient maze generator, who wants to judge it?

hoary matrix
#

xd

#

why wasted

#

it's amazing

halcyon phoenix
#

has somebody tried making one here?

hoary matrix
#

nope but dungeons yep

halcyon phoenix
halcyon phoenix
#

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

hoary matrix
#

dayummm

halcyon phoenix
#

I know there is a quicker way than this but damn

full idol
#

How do I find out which script caused this? It's on a realm, first time happening

fresh current
#

Hmm

remote oyster
# full idol How do I find out which script caused this? It's on a realm, first time happenin...

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.

full idol
#

Alrighty, thanks!

pale terrace
#

setRotation works on the player?

untold magnet
#

detecting the potion type is still on beta, right?

untold magnet
thorn flicker
pale terrace
#

F

thorn flicker
#

setRotation is weird anyway

pale terrace
untold magnet
thorn flicker
#

maybe thats why its weird when I use it

#

ive been setting the either the body rotation or head rotation to 0

#

I think

untold magnet
thorn flicker
#

you cant.

untold magnet
#

mhm,

pale terrace
thorn flicker
#

the method does not support players.

thorn flicker
pale terrace
thorn flicker
#

huh

untold magnet
thorn flicker
untold magnet
pale terrace
untold magnet
#

ya i see,

untold magnet
thorn flicker
#

then you have no other option.

untold magnet
#

especially while falling or keep rotating the player head

pale terrace
untold magnet
#

exactly

thorn flicker
#

you also can't use keepVelocity for players in teleportOptions.

untold magnet
pale terrace
warm mason
#

It's like they don't add support for Player for fun

untold magnet
wary edge
#

Me when I don't understand server/client communication.

pale terrace
#

how opening the inventory is server side? bao_ext_toldyouso

untold magnet
# warm mason It's like they don't add support for Player for fun

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.

remote oyster
granite badger
#

everything is server-side nowadays, even profanity

pale terrace
#

I played in a server with 300ms and opening the inventory is instantaneous

pale terrace
remote oyster
# pale terrace not in java edition

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.

pale terrace
remote oyster
pale terrace
#

and also, I dont know how it works but some clients can make the inventory client side

remote oyster
#

Not on Bedrock. Doesn't work that way.

pale terrace
pale terrace
#

yes, its on bedrock

remote oyster
pale terrace
#

Local doesnt make sense, you have 0 ping

remote oyster
#

Lies

pale terrace
#

Try it lol

#

try it on a high ping server

full idol
#

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

spare sentinel
#

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.

remote oyster
# pale terrace Try it lol

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.

pale terrace
#

bro just try the module on the client

#

and see it by yourself

granite badger
remote oyster
#

Which makes sense because you are on the same system that is hosting.

remote oyster
pale terrace
remote oyster
#

That's the problem. It doesn't. Not sure why you are still pushing this.

pale terrace
#

because I tried

#

but ok

remote oyster
#

Yea, except I don't see anywhere in their code where you could have "tried".

pale terrace
#

ok

#

if you say so

remote oyster
#

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++.

inland merlin
#

is there a way to detect how many custom items there are outside of vanilla?

#

from in game?

#

what addons add?

inland merlin
#

oh bet

distant tulip
#

give me a sec

inland merlin
#

legend thanks

distant tulip
#

ItemTypes.getAll()

and count them by namespace

inland merlin
#

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

distant tulip
#

doesn't that need file editing?

inland merlin
#

just so people could update if they added other addons

#

with new items

distant tulip
#

ah, that is cool

inland merlin
#

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

inland merlin
#

no more manual

full idol
#

Oh item textures don't support Alpha?

nocturne berry
#

How to spawn a specific potion item?

pale terrace
distant tulip
# nocturne berry How to spawn a specific potion item?
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})
fathom hemlock
#

can I hade a command if u don't have the tag admin?

#

oh nvm

nova flame
#
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

full idol
#

Is there a way to add enchantment gleam to custom items without them having the enchantment name?

nova flame
#

its a component

#

look for something with the word glint in it

full idol
nova flame
#

enchantment_glint?

#

ah

full idol
#

Thanks!

nova flame
#

ggs

pale terrace
full idol
pale terrace
nova flame
full idol
nova flame
#

am i not able to just apply damage to it

pale terrace
#

get the player mainhand and set the itemstack again

nova flame
#

wth

verbal yew
#

What is the thing to do Player Interact With Block

nova flame
#

?/

verbal yew
#

is there any way to add a tag to a block

nova flame
#

NO CLUE

#

Mb caps

wintry bane
#

entity.setViewRotation() when?

fast lark
#

Hi

gilded shadow
fast lark
#

#1366480200589770924 someone have some time to fix this dev resource?

lyric kestrel
verbal yew
lyric kestrel
#

I don't think you can do a dynamic tag like that unless you use scripting

lyric kestrel
#

Gens thing?

loud frigate
#

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?

gilded shadow
#

it's deprecated and ore ui is in development (ig)

#

so it'll likely arrive in 3-5 business days

loud frigate
#

ah. And with that we can make custom looking uis for our blocks and entities right? not just alter how vanilla stuff looks

gilded shadow
#

and there are alot of limitations

loud frigate
#

even when paired with action form data and such? oh well

gilded shadow
#

you should check it on Bedrock.dev and Bedrock wiki

distant tulip
#

-# this should be unpinned

sweet seal
#

How to TP each player with the same tag to a different location like random spawns but one person at each location?

wary edge
distant tulip
#

feel no longer relevant/needed

tulip osprey
#

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

tulip osprey
#

oh brother

#

beautiful

thorn flicker
#

you cant just ask the developer to make it toggle-able

tulip osprey
#

that's going to work

#

definitely

thorn flicker
#

better than being scummy

small cloak
#

What's wrong with editing addons?

tulip osprey
#

? how am I being scummy

#

literally just want to remove one simple thing

thorn flicker
#

think for a second

small cloak
#

I've been thinking about this for over a decade.

tulip osprey
#

oh yeah I'm going to distribute it to everyone totally

small cloak
#

Just look up a JS deobfuscator and fix it.

tulip osprey
#

okay thank you

small cloak
# thorn flicker think for a second

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.

thorn flicker
#

I don't find it weird at all.

small cloak
#

I've literally found out an addon was malicious after looking through it.

wary edge
small cloak
#

What if the professionals are in the wrong.

wary edge
#

Then someone has to refute it and then they become professionals.

small cloak
#

We need more Java creators to invade this space. works_as_intended

wary edge
#

But in Bedrock's case, these professionals(Marketplace) are heavily isolated of each other and have encryption which influences us hobbyists.

small cloak
#

Sorry for making this chat go off topic though. This is just something that bothers me about this community.

thorn flicker
small cloak
#

It's definitely problematic if the modified pack is distributed. I'd at least ask for permission.

thorn flicker
#

I just think people are just worried about their addons being stolen

small cloak
#

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.

shy leaf
#

there are so many websites that reupload my stuff

thorn flicker
#

it can also be people just wanting to gatekeep things.

small cloak
small cloak
#

Java isn't immune from those people too. 😅