#Script API General

1 messages Β· Page 119 of 1

thorn flicker
#

if you did the movement speed component method

#

unless im not remembering correctly

sage portal
#

yeah it hasn't happened for me or the few playtesters I've had. An unintentional but welcome side effect.

thorn flicker
#

but it should be the same

sage portal
#

ah, yeah I've never messed with movement in script, so I wouldn't know

thorn flicker
#

it sucks that it does this though, would be nice if they fixed it

#

somehow

sage portal
#

sounds like another thing that'll be in the back of the fridge, but I'll be optimistic

thorn flicker
sage portal
#

nope, never had any problems with speed in .json

#

my only issue is that it's, well, incompatible

thorn flicker
#

yeah

#

i wonder how long its been since the movement component class was added in the script api

#

was added in 1.12.0

sage portal
#

that's admittedly later than I expected, but still early enough that I'm surprised they didn't work on this yet

#

then again, we still can't do things like teleport players with velocity or set rotation

sage portal
#

we can now?

thorn flicker
#

rotation yeah?

#

im not sure about velocity

sage portal
#

I recently heard someone complaining that they couldn't, but I might be misremembering

thorn flicker
#

maybe you got confused? or hell maybe im misremembering

sage portal
#

ah, yeah that's what I figured.

thorn flicker
#

just another thing to hope they fix

warm mason
#

What's wrong?

thorn flicker
snow knoll
#

Why not just use player.applyKnockback

#

There's no effect on FOV

thorn flicker
warm mason
sage portal
#

that sounds egregriously complicated

snow knoll
#

Its not

warm mason
snow knoll
#

And I understand that it's bad for performance but its just a matter of what is more worth it to you

thorn flicker
#

applyImpulse is bad too for this

#

it'll be weird

#

and glitchy

warm mason
snow knoll
#

What makes applyImpulse better than Knockback anyways

warm mason
sage portal
#

For context: I'm using this movement for a boss rush map

warm mason
sage portal
#

for stuff like this #add-ons message

snow knoll
thorn flicker
snow knoll
#

Wrong @

thorn flicker
snow knoll
#

I meant myself

sage portal
#

So using things like impulse and knockback seems like too many variables to account for when the goal is to have the players input control where they're moving

thorn flicker
#

lol

#

confusion

sage portal
#

oh oops, my chat wasn't scrolling

thorn flicker
#

small intervals of speed boosts vs just the speed being consistent

#

i wouldnt touch impulse/knockback stuff

sage portal
#

yeah, same idea. the map is a high paced fighting game, so janky movement is really going to make it unfun, especially on the higher difficulties which were designed with movement in mind.

sharp elbow
#

If you need applyImpulse, go for it in single applications. Things like flinging a player one way one time (which applyKnockback will do just fine with too)

sage portal
#

I'm guessing I'll stick with player.json for now, I'll probably have a dev mode to mess around with the script movement component on the side to see if I'll fully commit to it.

thorn flicker
#

like, I think it would be glitchy

sharp elbow
#

No; if you need the player to move slower, modify the movement component either in the player behavior or in scripting. It's got some quirks of its own, but it puts full interpretation of the movement on the client

thorn flicker
#

however

#

.

sharp elbow
#

Yup, not great

thorn flicker
#

but yeah

#

it sucks

#

I wish this didnt happen

warm mason
#

Some attribute components need a "modifier" or "multiplier" property

sharp elbow
#

I have wanted to write a small attribute system that abstracts over stuff like the movement component. Like the attribute system Java Edition has

earnest meadow
#

really stupid stuff

warm mason
#

And does the result change if u use vanilla blocks?

earnest meadow
warm mason
earnest meadow
warm mason
earnest meadow
#

not entirely

#

so that's the functions problem or something

warm mason
earnest meadow
#

I don't understand how that's relevant, does the block json affect the function?

warm mason
#

Since the function takes into account blocks collision box

earnest meadow
#

I'm not on my PC rn

warm mason
#

Or maybe not

earnest meadow
#

Yeah, the block still takes in 16x16 but just thin

#

which doesn't make sense of the function not working

warm mason
distant tulip
#

Rays perform a check every n step, if your block is really thin the ray may skip it in some cases

#

It also skip blocks if the ray is towards the edge

thorn flicker
#

ive never got that to work properly

distant tulip
#

It works fine for me, what is the problem you are having with it

warm mason
distant tulip
thorn flicker
distant tulip
#

My current project uses it, so yeah, it works

earnest meadow
distant tulip
#

How big is the block collision box

#

Not selection box

earnest meadow
#

but I need it to be player passable

supple perch
#

yeah sure

#

you don't need to worry about that

#

btw is it possible to have optional dependencies now or no?

#

i haven't been keeping up with script api much tbh

supple perch
#

that won't stop the scripts from working

#

sorry if i didn't word it correctly

#

english is not my native language πŸ˜…

sharp elbow
#

Importing the script without the dependency throws an error; you could catch and swallow that error.

supple perch
#

yea i know

#

it's just

#

the game disables your script altogether

#

before that part

#

if one of the dependencies aren't available

sharp elbow
#

Does it do this if you use a dynamic import? With import("@minecraft/server-ui")

supple perch
#

not exactly

#

because it's available in all environments

#

unlike @server-net

#

it's not even there unless it's in the bds environment

supple perch
sharp elbow
#

Ah, server-net. I should have read a little more closely

supple perch
#

i heard they were working on optional dependencies a while ago

supple perch
supple perch
#

i would absolutely appreciate it

weary umbra
#

does any one has an creative fly function? I tried to recreate the creative fly so I can use it in survival mode but I failed, (I dont want use /ability)

prime zenith
#

Can i make a npc dislogue entirely with script

prime zenith
#

What is the script syntax to opendialogue

shut citrus
#

what is command macro, any example?

prime zenith
#

Is there a native way to call a function from a script or only run command

prime zenith
#

Wtf did they do to the chat send before event

#

Anyone here

mystic harness
prime zenith
#

World.beforeEvents.chatSend is not a valid event anymore

#

I verified syntax with an old pack they changed domething

#

I cant get it to work at all i went threw all avail options bridge has but nothing is available idk how to find whatever the change is

#

Oh shit chat send is in beta thats why

spice finch
#

Does anyone have a link to something that talks about where the new file locations are after the update?

prime zenith
#

Wow chat send has been in beta for years why just why

#

Im really annoyed at the 3 errors im getting that are minecrafts problem 3 duplicated vanilla recipes my pack has nothing to do with

fallow minnow
#

does anyone know why system.run does absolutely nothing for required permissions?

#

wrapping it in system.run does nothing

ripe dune
#

maybe if you put it in worldLoad event

fallow minnow
#

i had to do something like this

fallow minnow
#

no

warm mason
#

U are using getDimension without system.run

fallow minnow
#

wrapping it in something does nothing either way

warm mason
fallow minnow
#

doesnt

warm mason
fallow minnow
#

i already got it working its fine

warm mason
fallow minnow
#

since the dimension is used in mapForm

#

i have to do allat

warm mason
cinder shadow
#

literally unusable docs

#

Oh wait. that's actually how hunger and exhaustion are defined

#

why

round bone
mystic harness
#

do bossbars dont change dynamically? i tried to set nametag intervally but seems like it doest change at all

#

theres no way im gonna use hud title text for it once again 😭😭

mystic harness
#

πŸ’”πŸ’”πŸ’”

gaunt salmonBOT
frozen vine
#

If a block JSON object contains minecraft:tick but uses the custom component onRandomTick, is the component considered or completely ignored?

open urchin
#

if you aren't using onTick you shouldn't have the tick component since it's adding additional unnecessary data to the world

#

queued ticking (minecraft:tick & onTick) is completely separate to random ticking

frozen vine
open urchin
#

yes, onRandomTick is purely controlled by randomtickspeed, onTick is controlled by minecraft:tick

frozen vine
#

But according to the information I can remove this without any problem, I think it's just a missing component because before the leaves used onTick and it was changed to onRandomTick.

open urchin
#

leaves shouldn't use queued ticking, I assume it was implemented incorrectly originally

frozen vine
#

With onRandomTick, it is affected.

narrow patio
#

Is there a way to detect if a block that has been jumped on got broken by a subscribed event?

warm mason
#

wdym "by a subscribed event"?

narrow patio
#

a event

warm mason
#

If you mean all events, then definitely not

narrow patio
#

darn

wary edge
#

Whats your format version?

#

You need a format version of 1.21.80 or higher to use v2

silver agate
#

I’m having problems related to modal forms. Apparently it can’t define the default value of my dropdown correctly

ripe dune
silver agate
#

It worked, ty

sinful portal
# narrow patio darn

add a dynamicProperty to player to that specific block that was "jumped on" then if it on break event, trigger your logic when player dynamic property is set

narrow patio
#

Is OnBreak a custom component or a normal component

fallow minnow
#

they probably mean the playerBreakBlock event

amber berry
amber berry
supple perch
#

so update on this

#

i found the mob and changed it's component

#

but i need it to be dynamic

#

how exactly do i integrate it with player.setPropertyOverride

supple perch
supple perch
#

i don't think it exactly is server side

#

i haven't used it tho tbh

#

so idk what I'm doing

#

i kinda need some more guidance

#

also don't mind my very late replies and such, I'm just a bit busy irl

#

yea i don't think it's possible to select what players not to target based on a changing property

#

there isn't a single filter that does that

#

they all require a static value

sinful portal
#

how to add names or nametags in entity spawn?

small river
#

sry im rly bad at scripting, does anyone know how can I make a script so my projectile can break all the glass blocks when thrown ? (when it hits that glass block)

mystic harness
supple perch
supple perch
thorn flicker
supple perch
#

bonus: you can modify entity names (the default ones) in RP/texts/<language>.lang if you want that too

thorn flicker
supple perch
thorn flicker
supple perch
#

ah right

#

grammer

#

lol i thought it was just wording

thorn flicker
#

it was?

#

lol

supple perch
#

no like

#

uh

#

how do i explain

#

like

#

i can't explain πŸ˜…

#

but i do hope somehow you understand what i mean πŸ˜…

thorn flicker
#

honestly I dont

#

but thats fine

supple perch
#

good enough for me too lol

#

there we go

#

i am more identifiable now πŸ˜€

thorn flicker
thorn flicker
deep arrow
#

Hey peeps

modest bone
#

can somebody give me hint why I get "not a function" for Dimension.getWeather(); ? I saw something about beta so I did enabled Beta APIs and Im on "min_engine_version": [1, 21, 120] which looked also correct confuss

modest bone
random flint
#

A preview feature means it's on Minecraft preview... (Some kind of Snapshot for early-access update)

wheat condor
#

go on minecraft launcher and select latest preview

modest bone
#

I got that but I dont believe I have launcher, Im on MS store version

random flint
modest bone
#

I did simplified it, I do use basicaly what you wrote

honest spear
#

it might be in beta

wheat condor
#

yeah its on preview

random flint
#

Well, weatherChange afterEvents doesn't seem to be on beta~
-# Try using the event listener instead XD

honest spear
modest bone
#

πŸ˜† it sais beta ... Im confused

wheat condor
honest spear
#

just sayin

wheat condor
#

yeah it can

#

buty doesnt preview have a different beta version?

random flint
#

Hey, guys... does the legendary EntityHurt before Events fires regardless of whether the entity has iframe when being attacked?

gaunt salmonBOT
wheat condor
#

latest version its 2.4.0-beta

wheat condor
modest bone
random flint
ripe dune
#

im investing in this

drifting ravenBOT
#
Info

This bot was created by SmokeyStack for the purpose of making a FAQ bot for the Bedrock Add-Ons Discord Server.

Managing Entries

To manage entries, please make a pull request on GitHub.

Source Code
gaunt salmonBOT
wicked girder
#

lol

thorn flicker
#

they are asking if they are importing Dimension and trying to execute the method off of that, or getting the dimension properly from an event,
because obviously the first thing wont work.

deep arrow
#

Oh i see, my mistake i didnt fully see the replied message

thorn flicker
#

i think the question was not worded the best anyway

deep arrow
#

Well to be fair at times it can be a race to say what you want while you can as to not get ignored in this chat

deep arrow
#

Nothing lol just at times this channel gets chaotic

random flint
prime zenith
#

Anyone got tips for dealing with dyslexia

prisma shard
warped kelp
#

Good eveningg, would anyone happen to know why this script no longer works? The version is 1.21.124, and it does not seem to run :(
The functions exist, the sword has the trigger component

{
    const array = [
        "sword_check",
        "shield_bash_snow",
        "empty_check1",
        "empty_check2",
        "empty_check3",
        "empty_check4",
        "empty_check5",
        "sword_check1",
        "sword_check2",
        "sword_check3",        
        "slash_retreat",
        "spell_check_1",
        "spell_check_2"
    ];

    world.beforeEvents.worldInitialize.subscribe(({ itemComponentRegistry }) => {
        itemComponentRegistry.registerCustomComponent("hoarforst_antumbra:trigger", {
            onHitEntity(event) {
                const player = event.attackingEntity;
                player.runCommand(`function ${array[Math.floor(Math.random() * array.length)]}`);
            }
        });
    });
}
knotty plaza
warped kelp
#

I seee

#

I'll try that out, thank youu

warped kelp
#

That did not work

remote oyster
#

If it threw any warnings or errors you should share that.

warped kelp
#

How hard is it to make my swords run a function on hit 😭

warped kelp
warped kelp
wicked girder
#

Is it possible to prevent withers from breaking blocks? not the explosions but when they move and stuff

warped kelp
#

I'm sticking to components

remote oyster
# warped kelp The first one (which worked previous versions) ran no warnings, but it wasn't wo...

When you say previous version, which version specifically? Because your original code tried to implement the logic using an outdated method that was changed quite some time ago when they released the 2.0 version of the API.

https://youtu.be/owfBDnOHI_o?si=UyF0YEHq6SmJVvDJ

A detailed video about the infrastructural changes in how Script API v2.0.0 beta works -- it's not that different from v1.0.0, but we'll cover the subtleties in this video. Warning: there isn't really any discussion about newer APIs in this video, so not a lot of new fireworks on display :)

Scripting API 2.0.0 Documentation: (docs coming soon,...

β–Ά Play video
#

That video explains the changes in the order of operations.

amber granite
#

?

#

Wait

#

Did they change scripting intierly

remote oyster
# amber granite Did they change scripting intierly

Going on a year now. They didn't change much externally back then. It was mostly on how everything executed under the hood and in what order. We just had to adapt our current code at that time to follow suit with that new order. For the majority it was a seamless change with very little issues. For others, it was a learning curve.

amber granite
#

Ohk

warped kelp
remote oyster
#

It had already been replaced by that point.

warped kelp
#

Damn aight

#

Must've been hallucinating πŸ₯€

small river
mystic harness
small river
mystic harness
#

its okay

#

one sec

#

@small river

#
import { world } from "@minecraft/server";

world.afterEvents.projectileHitBlock.subscribe((ev) => {
    if (ev.projectile.typeId !== "minecraft:snowball") return;

    const block = ev.getBlockHit()?.block;
    if (!block) return;

    if (block.typeId.includes("glass")) {
        block.setType("minecraft:air");
    }
});

just a guess, correct me if im wrong

small river
#

bro thank you it works @mystic harness

supple perch
gaunt salmonBOT
gaunt salmonBOT
harsh hare
#

did anyone chest ui still works?

#

@valid ice's chest ui

valid ice
#

πŸ—Ώ

harsh hare
#

because its shows no item texture for me

#

after the .130 update

valid ice
#

That’s crazy

harsh hare
#

the id testing addon also seems not working

#

also no texture

valid ice
#

Well, you can try to fix it yourself, or wait until I get home from work

harsh hare
#

idk how to fix this tbh

valid ice
harsh hare
valid ice
somber onyx
#
function summonCharrette(targetNation: Nation): Entity | undefined {
    const location = getEnemySpawnLocation(targetNation);
    if (!location) return undefined;

    try {
        // @ts-ignore
        return location.dimension.spawnEntity("cb:charrette", location);
    } catch (e) {
        console.warn("Erreur spawn charrette: " + e);
        return undefined;
    }
}

hi, someone knows how to bypass or an alternative solution to that

wary edge
somber onyx
#

yes, normal I have two almost identical functions for each entity

function summonFlag(targetNation: Nation): Entity | undefined {
    const location = getEnemySpawnLocation(targetNation);
    if (!location) return undefined;

    try {
        // @ts-ignore
        return location.dimension.spawnEntity("cb:flag", location);
    } catch (e) {
        console.warn("Erreur spawn drapeau: " + e);
        return undefined;
    }
}
wary edge
#

Ok so...is cb:flag a valid entity?

somber onyx
#

is a custom entity

wary edge
#

And you can summon it

somber onyx
#

yes

#

oh no indeed not flag I hadn’t paid attention

#
{
    "format_version": "1.16.100",
    "minecraft:entity": {
        "description": {
            "identifier": "lu:flag",
            "is_spawnable": true,
            "is_summonable": true,
            "is_experimental": false
        },
        "components": {
            "minecraft:scale": {
                "value": 1.5
            },
            "minecraft:physics": {
                "has_gravity": true,
                "has_collision": true
            },
            "minecraft:pushable": {
                "is_pushable": false
            },
            "minecraft:push_through": {
                "value": 1
            },
            "minecraft:fire_immune": true,
            "minecraft:damage_sensor": {
                "triggers": {
                    "cause": "all",
                    "deals_damage": false,
                    "damage_modifier": 0
                }
            },
            "minecraft:knockback_resistance": {
                "value": 1
            },
            "minecraft:nameable": {
                "always_show": true,
                "allow_name_tag_renaming": true
            }
        }
    }
}

cb:flag isn't summonable but it's summonable in json file ?

wary edge
#

I mean, that clearly says lu:flag not cb:flag

somber onyx
#

oh shit indeed sorry I am an idiot

noble tiger
#

What's the up-to-date version of minecraft/server? Is it 2.3.0 or 2.4.0?

sharp elbow
#

2.4.0 as of today's release, 1.21.130

gaunt salmonBOT
mystic harness
#

what stable beta to be used for the module in 1.21.130?

#

is it 2.6.0 beta?

shy leaf
mystic harness
shy leaf
#

2.4.0

mystic harness
#

okay thanks

#

dang it i cant see the changelog for 2.5.0 beta where can i find it

marble sigil
#

If I wanna spawn alot of XP at one location, do I just do this:

for(let i = 0; i < 64; i++) {
dimension.spawnEntity("minecraft:xp_orb", {
x: x + ((Math.random() - 0.5) * 5),
y: y + ((Math.random() - 0.5) * 5),
z: z + ((Math.random() - 0.5) * 5)
});
}```
?
harsh hare
valid ice
#

Nope

#

Fiddled around for two hours, no luck

prime zenith
#

I never got an answer to this how many custum items do you think minecraft can handle

honest spear
#

try it

#

hard to guess

prime zenith
#

I feel like i need to find an alternative to thd parts i want to add

The parts alone adds 209 items not counting ore an bars tools weapons and many more

runic crypt
#

How to detect right-clicks when player is empty-handed?

prime zenith
#

Use interact with block event check mainhand snd offhand to be empty

#

If you want @runic crypt i have a file that can help you thats actually is pretty easy to do

runic crypt
prime zenith
#

Maybe item use idk but i think if you use nothing it comes back undefined you can test that its undefined ima test

#

Nvm i dont think theres an even reading judt a right click im looking at how the gsme does a right click snd it does nothing on its own

#

I think i can detect a left click with no item tho lol

#

Ya i can detect a left click and i know i can detect sneaking just no right click

#

@runic crypt there is no way to detect a right click thats in the air

You can detect every other thing they can target but they need to be targetting something

honest spear
#

yea block entity or item in hand

prime zenith
#

Keep in mind even if the block or entity has no interaction aspect it still triggers event

#

Its weird as i can detect every other thing crouch left click ect just not right click

mystic harness
#

whats new in 2.5.0-beta

prime zenith
#

I need advice

So i have 11 parts of 19 tiers plus each tier has its own set of ores bars armor tools weapons im wondering is there a better way so im not making hundreds of custum items

honest spear
last latch
#

Could anyone help me with the camera thingy? Is it possible to rotate the camera with in_out_cubic animation whilst facing a location?

mystic harness
#

cus im not used to check mc changelog in terms of server module change nad now server module is missing 2.5.0 changelog

harsh hare
#

maybe there some update in json ui ig that makes unable to use aux item id

shell sigil
#

Is it possible to hide form
I want to hide a server form Evey 1s if player don't click anything

round bone
#
Minecraft Wiki

Modifies player's camera view. /camera <players: target> . . . … clear … fade . . . … color <red: int> <green: int> <blue: int> … time <fadeInSeconds: float> <holdSeconds: float> <fadeOutSeconds...

sharp elbow
fallow minnow
#

how do i know which biome im in

shy leaf
#

it returns BiomeType, which has id property

#

wait

#

when did getBiome

#

get into stable

fallow minnow
#

im not seeing it

shy leaf
deep arrow
prime zenith
#

I need advice

So i have 11 parts of 19 tiers plus each tier has its own set of ores bars armor tools weapons im wondering is there a better way so im not making hundreds of custum items

warm mason
prime zenith
#

Well parts are just crafting components made from a parts crafter

#

I mean im half tempted to just create my own inventory using properties

#

I mean i already made 1 parts crafter be able to act as 19 different parts crafters threw an upgrade system

untold magnet
#
system.beforeEvents.startup.subscribe(init => {
        init.blockComponentRegistry.registerCustomComponent('sample:my_custom_block_component', {
            onEntity: (e: BlockComponentEntityEvent) => {
                if (e.name !== "sample:my_entity_named_event") return;
                const block = e.block;
                const source = e.entitySource;
                ...
            },
        });
    });```block entities?
wary edge
#

No.

untold magnet
#

damn it

amber granite
#

؟

#

What's there @untold magnet

untold magnet
prime zenith
#

I wouldnt mind tool softwares that charge a 1 time fee of $50 for high end recorders and such but i do mind monthly subscription softwares its do annoying beyond belief why are all new softwares even when it doesnt req a server suddenly monthly subscriptions

prime zenith
#

Can anyone teach me how you add a sound file and call the sound file in screipt

harsh hare
broken pawn
#

i guess it's working

prime zenith
#

Can anyone teach me how you add a sound file and call the sound file in screipt

sage portal
#

Am I dumb or is there no stopSound() method?

earnest meadow
#

odd, i know

sage portal
#

I don't even know if I wanna facepalm or laugh

prisma shard
#

And more funily enough stopSound was added in a bit ago recent update

prisma shard
# prime zenith Can anyone teach me how you add a sound file and call the sound file in screipt

you can put sounds in the sounds/my_new_sounds folder for example
and define them using sound_definitions.json.
Then you can play the sounds using /playsound or using playSound method in scripts as of the name you defined in your sound definitions.
look at the wiki for complete information:
https://wiki.bedrock.dev/concepts/sounds

prime zenith
#

Ohh thats super easy

Minecraft accepts a .wav file for dound correct

#

Btw dont ever let ai try to read 1 of your poems to you it did horrible

sinful portal
#

are custom crossbows only works in script API?

prisma shard
sinful portal
# prisma shard what?

the provided vanilla bp official pack repo does not contain crossbow.json nor the bow.json similarly how they removed blocks.json files. the shooter component in the bp items/item.json doesnt specify the properties of a crossbow, all options are only similar to bows such as charge on draw, launch powerscale, etc.

#

I recently saw in the script resources of someone making a crossbow template as someone provided it to me, but they only used script API on the crossbow loading system.

worn sphinx
#

Why is the watchdogTerminate code broken in version 1.21.30?
Code:

system.beforeEvents.watchdogTerminate.subscribe((event) => {
  event.cancel = true;
  console.warn(
    `[Watchdog] Cancelled critical exception of type '${event.cancelationReason}'`
  );
});
prisma shard
warm mason
#

if not, that's the reason

worn sphinx
warm mason
worn sphinx
warm mason
worn sphinx
neat hazel
#

How do you make an entity follow the player after interacting with it?
Like a pet

amber granite
#

@prisma shard thank u :-:

#

I found the problem

prisma shard
#

welcome

silver agate
#

Is there any way to spawn an item with enchantments and durability with dimension.spawnItem()?

cinder shadow
silver agate
cinder shadow
#

yes

#
const newItem = new ItemStack('minecraft:diamond_sword', 1);
    newItem.getComponent("minecraft:enchantable").addEnchantment(new EnchantmentType({type: 'unbreaking', level: 3}));
    Dimension.spawnItem(newItem, player.location)```
cyan basin
# harsh hare have you find a fix?

Fixed the Aux IDs not displaying and updated the Type IDs. I've somewhat rewritten it in typescript so some of the code will be different. Also I removed the Furnace Form (if you used it).
https://github.com/Sprixvy/Chest-Form

GitHub

A Minecraft: Bedrock Script API pack that alters the Action Form UI to look & function like a chest does, without the hassle of entities or physical items. - Sprixvy/Chest-Form

somber onyx
#

hey, did you know how one can efficiently store an entity in a dynamicProperties ?

distant tulip
#

You can't store/get all it data, use structure api

round bone
cyan basin
#

i don't have a script to view them i just have a python script that fetches all aux ids from some guys api and then creates a ts file for it

#

he seems to always keep it up to date so why not use it

round bone
spare fox
#

Wondering if there is a way to automate this, as your really slow to update it

supple perch
#

would be fantastic to have

harsh hare
#

thank you

#

so yeah, something was wrong in json ui about aux id

cyan basin
#

ignore the names 🀣 was just adding custom nametag visibilty, enchant support and clickable inventory slots

#

i made this a while ago but lost it to the unknown 😭

#

Then you would just check the type by doing res.type ('container' or 'inventory') ```ts
const res = await form.show(player);

if (res.canceled) return;
if (res.type === 'container') {
console.warn(container, ${res.slotIndex});
return;
}```

spare fox
#

it seems you need a - ']' now compared to the last update?

#

did mc add something?

cyan basin
#

it's just some goofy bypass for it lmao

spare fox
#

what changed

cyan basin
#

honestly.. my friend figured it out for his server then gave it to me lol

#

he knows a bit more json ui than me

spare fox
#

this is important, can you mention him here?

cyan basin
#

he said he doesn't even know either πŸ’€ that's just what he does and it works

spare fox
#

we need to figure out who did this

cyan basin
#

@naive tinsel

naive tinsel
#

sup

spare fox
naive tinsel
#

i had it in my ui already and mine was working after the update

spare fox
#

well that one thing is the reason it works

naive tinsel
#

you can do percentage multiplication on the string or minus some random character and it fixes it

naive tinsel
spare fox
naive tinsel
#

ig so

spare fox
#

@spring axle any idea what changed in JSON-UI to cause this? (#1067535608660107284 message) Basically, now you need to subtract something for a string to convert to a number?

spring axle
#

We updated some text formatting stuff recently, so maybe that?

spare fox
#

as this might break a ton of my UI's

cyan basin
#

this was the change that was in the changelog

naive tinsel
#

('%.10s' * #title_text)
(#title_text - ']')
either of these methods work, you have to manipulate the string in some way and it fixes, idk why lol

spare fox
cyan basin
#

There was also this Added resolve_ancestor_scope boolean to view bindings as a way to bind to an ancestor that matches the source_control_name but it's not much use to me. Also maybe move this to #1067870274894172260 lol

umbral scarab
#

Could someone help me understand why this doesn't work? (Console.warn isnt being ran)

const boots = new ItemStack("minecraft:leather_boots", 1);
        const dyeComp = boots.getComponent(ItemComponentTypes.Dyeable);
        
        if (dyeComp) {
            console.warn("1");
            dyeComp.color = {blue: 255, red: 255, green: 255};
        }
naive tinsel
#

because it doesnt have that component

#

simple answer

deep arrow
#

Who r u

umbral scarab
naive tinsel
#

list the components with getComponents

#

i think its called that

cyan basin
#

it is called that

umbral scarab
#

ok tyty

harsh hare
prime zenith
#

Hey so i was told theres a way to make npc's move with script how is this done

tawny peak
#

does anyone know where the downloaded multiplayer textures go in the new GDK update?

#

the file location i mean

fair quarry
ripe dune
tawny peak
#

thanks!

prime zenith
#

Hey so i was told theres a way to make npc's move with script how is this done

gaunt salmonBOT
broken pawn
#

Will this Works?

AE.entitySpawn.subscribe(({cause,entity})=>{let EFamily=entity?.getComponent(EntityComponentTypes.TypeFamily);
    if(EFamily?.hasTypeFamily("monster")){
        if(entity.dimension.id=="minecraft:overworld"){ImplantEffect(entity,EffectPools,0);}
        else if(entity.dimension.id=="minecraft:nether"){ImplantEffect(entity,EffectPools,1);}
        else if(entity.dimension.id=="minecraft:the_end"){ImplantEffect(entity,EffectPools,2);}
    };
});
#

i mean the "entity.dimension.id=="

broken pawn
#

well, imma test this

#

also it's always better using else for performance right?

#

now it's my 1st year learning Js

#

πŸ—£οΈ πŸ”₯ πŸ”₯

honest spear
broken pawn
#

sure enough, i'd love if my code can use UpperCase

subtle cove
#
const N = ["overworld","nether","the_end"].findIndex(dim=> dim==entity.dimension.id.substring(10));
ImplantEffect(entity,EffectPools,N);
#
const N = {o:0,n:1,t:2}[entity.dimension.id[10]];
ImplantEffect(entity,EffectPools,N);
#

mind me not, it'll only get confusing

broken pawn
#

wait

#

i forgot about the implant function

#
function ImplantEffect(A,B,C){A.runCommand(`Effect @s ${B[(Math.floor((Math.floor())*B.length))]} Infinite ${C} True`)};
const EffectPools = [`Speed`,`Strength`,`Resistance`,`Slowness`,`Weakness`];
honest spear
honest spear
#
const dId = {"minecraft:overworld":0,"minecraft:nether":1,"minecraft:the_end":2}[entity.dimension.id];
ImplantEffect(entity,EffectPools,dId);

not sure why using id as number tho if you already have string

broken pawn
#

the number is for how much effect amplifier

#

not the dimension

honest spear
#

hmmmm

#

Β―_(ツ)_/Β―

broken pawn
#

i guess i'll test it out

wheat condor
#

why are you using a command to use the effect

subtle cove
#

how to put infinite with api

broken pawn
#

i can use addEffect, but i wanted the Infinite

honest spear
#

idk if thats fixed now

#

Maybe we should have report it if not

broken pawn
#

if it doesn't work, i'll write it down here

honest spear
#

good

subtle cove
#

how does -1 behave on it

broken pawn
#

can i use array for this?

const NetherFamily = ["Piglin","Wither_Skeleton"]
entity?.getComponent(EntityComponentTypes.TypeFamily)?.hasTypeFamily([NetherFamily])
thorn flicker
#

and use the includes function

broken pawn
#

the "hasTypeFamily" to "getTypeFamilies"?

sounds similiar like "getGameMode"

thorn flicker
#

its just a different method.

broken pawn
#

sure, i'll try it

thorn flicker
#

use some or every, and within the method, use includes.

broken pawn
#

will forEach works?

thorn flicker
#

focus on the first answer.

broken pawn
#

this is gonna help a lot

thorn flicker
broken pawn
#

very Understandable πŸ—£οΈ πŸ”₯

i'll try it next day after wake up

deep arrow
#

But fair

thorn flicker
#

for specific things

deep arrow
#

Don't doubt that

thorn flicker
#

and its good for learning yk

#

thats the point

#

lol

deep arrow
#

Lmao

#

No way for something as random as that

thorn flicker
#

and just use indexOf for the element to insert

deep arrow
thorn flicker
#

hm

deep arrow
thorn flicker
#

I dont deal with substrings alot

#

what are you creating?

deep arrow
#

Oh nothing, i didnt actually "need" a tutorial for it. It was more of a question of if one such tutorial existed

thorn flicker
#

lmao

deep arrow
#

I know how to do what i asked anyways

deep arrow
#

Pretty useful in alot of cases, well formatting cases ig

thorn flicker
#

yeah, I just dont see a need for it for what ive been doing.

thorn flicker
#

i use js

#

lol

deep arrow
#

:(

thorn flicker
#

typescript really does seem nice

deep arrow
#

Its great

thorn flicker
#

I just havent put effort into trying it

#

I just dont care really, right now anyway

deep arrow
#

Once i switched from js, to ts i can never go back

deep arrow
thorn flicker
#

I just dont need it

deep arrow
#

You may not need it but you should want it

thorn flicker
#

everything in js, and what im doing right now, is not that infuriating for me to switch

#

like, im comfortable

deep arrow
#

Thats fair

#

I just cant live without the ease of ts anymore

#

So i must spread the gospel of typescript

thorn flicker
#

well atleast you arent spreading it with a superiority complex

deep arrow
#

Like the type safety is so great, being able to see errors before runtime.

deep arrow
#

If others dont like it, they dont like it. Simple as that

thorn flicker
#

other people are not as cool as that

thorn flicker
#

one thing I need to do is move off Bridge, like really

amber granite
#

If typescript is complex , then try c++

deep arrow
thorn flicker
deep arrow
#

Bridge is crazy work

deep arrow
thorn flicker
#

im lazy to switch man

thorn flicker
thorn flicker
deep arrow
thorn flicker
#

loll

deep arrow
#

Respect has nothing to do with that lmao

remote oyster
thorn flicker
thorn flicker
#

ive known this for awhile now

thorn flicker
#

@honest spear you said something?

#

message was instantly deleted lol

honest spear
#

I guess i don't like that tutorial i guess, but if you don't care about performance then good enought Β―_(ツ)_/Β―

thorn flicker
honest spear
honest spear
honest spear
deep arrow
#

:0

honest spear
#

substring is goated

#

the right way to do stuff and the fastest

#

Β―_(ツ)_/Β―

#

also Uint8Array.subarray is the same thing

thorn flicker
honest spear
#

πŸ‘

thorn flicker
honest spear
#

O(1) vs O(n) multitples by counter part

#

just sayin

#

Script api engine is really specific tho

#

but still works well

#

anyway my solution would propably be entity.match(selectorWithFamilies)

thorn flicker
honest spear
#

but maybe someone did

#

so check if google has something

#

there has to be an example one Sets vs Arrays

#

Also Sets in newer ES versions has methods like symetricDifference() thats perfect for large operations

thorn flicker
#

I know there is.

honest spear
#

ok

thorn flicker
#

but since you had a problem with that one article above, maybe you had a page that you specifically like when it comes to sets and arrays

#

idk

honest spear
#

maybe some really annoying edge case

#

only thing i miss sometimes is map and filter being one method

deep arrow
#

or the other similar classes

deep arrow
#

but technically u can filter with map, just make it undefined

#
arr.map(x => x > 5 ? x : undefined)
sudden nest
#

Hello, quick question, u can't put dynamic property to stackable items, aren't ya?

amber granite
#

Did they add something new , idk like new events ?

amber granite
#

What is it ?

thorn flicker
#

entityHurt beforeEvent, entityHeal after/BeforeEvent

#

entityItemPickup after/beforeEvent

amber granite
#

Hmmm , looks good

thorn flicker
#

world seed property

sudden nest
#

Ohhh entityItemPickup, haven't seen that one

thorn flicker
#

yeah its in newest preview

amber granite
#

Hmmm , is anything new related to blocks ?

thorn flicker
#

onEntity

#

triggers when an entity reachs the block if its defined as a home block

wheat condor
#

script api is evolving so fast

amber granite
#

Hmmm

#

For items ?

thorn flicker
#

no

amber granite
#

Huh

thorn flicker
#

well, there's cooldown related stuff

wheat condor
deep arrow
amber granite
thorn flicker
wheat condor
wheat condor
thorn flicker
amber granite
#

1 month is fast , two i don't guess so

wheat condor
thorn flicker
#

maybe in terms of addons

#

lol

amber granite
#

U know in 2 years how Minecraft java modding com get evolved

wheat condor
amber granite
#

;-; yep , but facts are facts

#

I mean u got little pieces of the big cake i mean

wheat condor
#

they still have to do a LOT of stuff about ui-scripting connection

thorn flicker
#

another 2 years for that

amber granite
wheat condor
#

i'd say more seeing ore ui isnt even customisable yet

honest spear
amber granite
#

I guess they gonna change it with the new one ui

#

I heard they are doing something to the furnace ui

wheat condor
#

yeah .filter is better

wheat condor
#

getting a new style

honest spear
amber granite
amber granite
#

Like they will remove them ?

wheat condor
amber granite
#

So using html right?

thorn flicker
#

its based on react right

amber granite
#

I heard it s based on html or something

thorn flicker
amber granite
#

Yep

#

You are right

cyan basin
#

Interactable inventory and potion support in the custom Chest Form πŸ₯³ 😭

cyan basin
# harsh hare you said that you using typescript, can you also provide the typescript code in ...

Hey, sorry.. I completely forgot about this last night. I've pushed the typescript repo under a new branch:

https://github.com/Sprixvy/Chest-Form/tree/typescript

GitHub

A Minecraft: Bedrock Script API pack that alters the Action Form UI to look &amp; function like a chest does, without the hassle of entities or physical items. - GitHub - Sprixvy/Chest-Form at ...

#

This is modified so go careful, I've changed the way the buttons work so you might need to adjust some code.

#

Buttons now look like this: ts form.button(12, 'Grass Block', 'minecraft:grass_block', { amount: 1 }); form.button(14, 'Diamond Sword', 'minecraft:diamond_sword', { description: ['Β§7Sharpness V', '', 'Test (1)', 'Test (2)'], durability: 50, enchanted: true, });
They have an options object for the other parameters. You'll see that in the index.ts file

prime zenith
#

Hey so i was told theres a way to make npc's move with script how is this done

warm mason
prime zenith
#

I wish someone would teach me how to make a custum entity the learn dics did not help me

prime zenith
#

Thats what i mean by the learn docs

#

They did not help me to understand

warm mason
# prime zenith They did not help me to understand

In this session, Mike Ammerlaan covers the basics of the systems of entities and how they work, describe a couple of example usages, and then use mctools.dev and Blockbench to build a first entity.

Samples:

You can see samples (including a Camp Ghost) for Creator Camp at https://github.com/microsoft/minecraft-samples/tree/main/creator_camp

β–Ά Play video
prime zenith
#

No what i need is some how a walk threw that actually builds 1 that doesnt jump right to a get your x from y and assuming i understood x

And i understand the mob.json

I do not understand custum geometry annimatuon how i get a creation from blockbench to minecraft ect

wary edge
#

That's not a scripting thing. I also don't know where you heard that.

inland merlin
#

What if shes thinking about gametest for fake player?

#

Seems different tho from what was explained

prime zenith
#

No i think someone told me something wrong its fine npcs have strong legs

prime zenith
#

I both love and hate the forms they look awefyl but im no good with json ui the inventory systems i make are effective but ugly and complex

snow jungle
snow jungle
last latch
#

then idk dude just forwarded an answer to an identical question

snow jungle
#

ok thanks

prime zenith
#

Has anyone seen an addon that has over 1000 custum items noones given me a limit so id like to see if i can figure out safe zones

broken pawn
#

What is this?

turbid delta
#

itemPickup is added.....

#

But no documentation of it exists...

sudden nest
#

Is there a way to put dynamic property to a block?

wicked girder
#

Whats this error mean?

wicked girder
#

Figured it out was providing a null array to a dropdown lol

empty yoke
#

Does startItemCooldown() reset if you exit the world?

shy leaf
#

it wouldnt make sense if it did

empty yoke
#

I used it and when I exited and re-entered the world the cooldown was 0

last latch
#

If its like 3 seconds, before your client stops loading it will probably end.

#

try with like 10 minutes or so

empty yoke
# last latch How long was the cooldown?

between 30 and 120 seconds, I just tried to activate the ability and set the cooldown to 30 seconds, I exit after about 3 seconds and when I rejoined in the world I find the cooldown at 0

last latch
empty yoke
#

Did they break the cooldown or has it always been this way?

last latch
empty yoke
#

Maybe I'm doing something wrong, I'm setting the cooldown on the player, and in the item's cooldown I put duration: 0, correct?

last latch
#

idk, im a json ui typa guy

empty yoke
empty yoke
empty yoke
# empty yoke

Can anyone tell me if this is a problem with the new update or if I'm doing something wrong?

shy leaf
#

it could be that they actually dont keep track of the cooldown since theyre usually short

#

so this kind of situation wouldnt matter

#

what you could try is to store the cooldown as dynamic property in player and load it when the player rejoins

empty yoke
modest bone
#

const time = world.getTimeOfDay(); for script

empty yoke
modest bone
empty yoke
# modest bone Maybe standard ``Date.now()`` from js (I guess it would be server time?) - it sh...

Yes, in fact I opted to use that, saving the current time when the player uses the ability and then comparing it with the recent time, even though I would have preferred to recover the player's life time in the world, saving the moment in which he used the ability so that in case the player exited it would stop, and it would resume the time only when the player re-entered and compared it with the old time, but I assume that you have to create an internal timer for each player to use such a system?

empty yoke
modest bone
#

Thinking about it if I did it from standard server gamedev perspective I would have probably some loop on server through all active players and handle their CDs there ... but when I tried it in my game in Unity way back it was still not great - timings over network are horrible to deal with πŸ˜„ ...

empty yoke
#

So you think the best way to avoid performance issues is to save the time and compare it to the current time avoiding loops, but having the problem that when you are offline the cooldown runs the same, so it ends, even if it would make sense if it was a world always online like a realm

modest bone
#

Question is - does it even make sense to pause CD if player logs off? Depends what you want to achieve but for ability CDs is it worth the extra hassle? πŸ™‚
depends also if you have 6s CDs or 12h CDs I guess

empty yoke
modest bone
#

No problem, discussion tends to help πŸ™‚
Out of curiosty - do you show the progress in UI somehow? (maybe its not even possible in MC, I have still lot to explore)

empty yoke
supple perch
#

heya guys

#

how you doin'?

#

whatcha workin' on?

gaunt salmonBOT
wicked girder
#

Can you not use the latest stable beta debug util with the latest stable beta server?

#

npm no like when I install it after installing server

#

was able to get it to install by installing debug util first then the server

shrewd relic
#
    if (e.projectile.typeId === "ww2:spot_projectile") {
        const player = e.source;
        const coord = getCoords(e.location);

        const validNations = ["american", "german"];
        const playerFaction = player.getTags().find(tag => validNations.includes(tag));
        if (!playerFaction) return;

        if (!globalAnnounce) {
            for (const p of world.getPlayers()) {
                if (!p.hasTag(playerFaction)) {
                    ClassBroadcast(player, "Spots", coord, e.location);
                }
            }
        } else {
            ClassBroadcast(player, "Spots", coord, e.location);
        }
    }
});

my brain power aint up for this 😭 is there any way to send messages to people with the same tag?

lethal bramble
#

nvm

supple perch
#

heya

#

anyone know if it's possible to use animation controllers to detect when the player lands after they jump?

#

i can do it with script but i already got around 3 intervals, and I don't want a fourth

#

and a 20 ticks interval isn't doing me any well either tbh

supple perch
round bone
granite cape
#

im soo bored

lethal bramble
#

hi

last latch
supple perch
#

one is ran every 20 ticks

#

one is ran every 40 ticks

#

and one is ran every 60 ticks

#

they all serve different purposes

#

and they're across packs.

#

but they complement eachother

last latch
#

i see

#

nothing i can say xD

supple perch
#

also I'm using a PlayerPulseScheduler for even better performance

last latch
#

what is it

supple perch
#

from @bedrock-oss/bedrock-boost
it basically splits the work into ticks.
if you schedule for 20 ticks and have 1 player, every 20 ticks it'll do something

#

if you have two players and 20 ticks, every 10 ticks one will be handled

#

and so on

#

Basically splits the work across ticks

supple perch
supple perch
#

or idk play something

#

or watch dragon ball 😭

supple perch
#

πŸ˜…

supple perch
# shrewd relic ``` if (e.projectile.typeId === "ww2:spot_projectile") { const playe...
if (e.projectile.typeId === 'ww2:spot_projectile') {
  const player = e.source;
  const coord = getCoords(e.location);

  const validNations = ['american', 'german'];
  const playerFaction = player.getTags().find(tag => validNations.includes(tag));
  if (!playerFaction) return;

  if (globalAnnounce) {
    for (const p of world.getPlayers())
      ClassBroadcast(p, 'Spots', coord, e.location);
    return;
  }
  
  for (const p of world.getPlayers()) {
    if (p.hasTag(playerFaction))
      ClassBroadcast(p, 'Spots', coord, e.location);
  }
}```

i cleaned up the code a bit.
i use 2 spaces for indentation and single quotes but you are welcome to change those as much as you like.
I made this code on pure guess of what ClassBroadcast does, feel free to provide the function definition if this doesn't work.
and maybe some context.
#

you should avoid branching too deep since qjs is interpreted not just in time compiled, so it hurts performance unlike in something like V8

#

(the scriptapi environment is qjs currently)

lucid dust
#

how do i add an effect without particles using addEffect() ?

open urchin
frozen vine
#

How do I fix the "unknown" parameter errors in the @gaunt salmon bot with custom components?

prime zenith
#

With script how do you summon an entity with a specific display name and how do you get that display name

thorn flicker
prime zenith
#

Im asking to summon it tho

thorn flicker
#

I know?

#

spawnEntity summons an entity.

prime zenith
#

But can i detect if script was its sourse

Spawn entity gets the dntity after its spawned tho

#

Ohhh

thorn flicker
#

i didnt say anything about the entity spawn event

prime zenith
#

I have dyslexia so i read that as entitySpawn

thorn flicker
#

okay

prime zenith
#

For that i need to pull dimension? Or just world

thorn flicker
#

so you could just put the spawnEntity method in a variable, and then just edit the property

thorn flicker
thorn flicker
prime zenith
#

Location is an object x:,y,z:, right

thorn flicker
#

yes

prime zenith
#

Does it run just set as a var or do i need to call it

thorn flicker
#

its already being called

prime zenith
#

And i can also set dynamic properties right then snd that sweet

thorn flicker
#

and just get the same nametag property and use it in an if statement.

prime zenith
#

So if not set it will return undefined or null

thorn flicker
#

yes, it'll return undefined

prime zenith
#
    spawnMob.nameTag = "test"``` says not a function and before you say caps i tested it for some reason the export for Dimension is capital i tried
thorn flicker
#

you exported Dimension and tried calling it from that?

#

thats wrong.

prime zenith
#

yes

thorn flicker
#

that wont work.

#

you need to retrieve the class from something.

#

either from a block, entity or the world class.

prime zenith
#

what class i thought dimension was the class

thorn flicker
#

it is.

prime zenith
#

ohhh dso world.dimension

thorn flicker
#

it depends.

#

what is this code in?

#

do you have access to an entity or block?

prime zenith
#

Its in a use event for testing

thorn flicker
#

do source.dimension

#

gets the current dimension of the source.

prime zenith
#

Ohhh i get it now

thorn flicker
prime zenith
#

So whatever the activater of the event is

Does that mean if i ran this in an uncontrolled entityspawn event id spawn entities til i crashed

supple perch
#

probably

supple perch
prime zenith
#

Already crashed once today accidently had my get player comp call a func that called get player comp lol

thorn flicker
#

maybe a tag

thorn flicker
supple perch
#

plus tags have a limit. could be reached faster than dps

prime zenith
#

Oh i dont plan to do that i was curious

thorn flicker
#

i know

supple perch
#

a boolean property in script or dynamic property are the best method

supple perch
prime zenith
#

I need to do it in a system.run dont i

supple perch
#

well depends on the context

thorn flicker
#

depends.

supple perch
#

if you are in a read-only context like a before event, you do

prime zenith
#

Yup i am

supple perch
#

if you intend to run it from something like an after event or in an interval, then no

thorn flicker
supple perch
prime zenith
#

That makes alot more sence with how you worded it

supple perch
#

no worries

#

I'd recommend reading the script v2 change and also the permissions update

#

they'd help understand this with visuals

thorn flicker
prime zenith
#

If i applied a damage of 0 that calls entity hurt correct

prime zenith
#

I enjoy reqritting the entire combat system i just wish adhd and dyslexia didnt get in my way

#

Wait if i spawn entity then set nametag if i have entity spawn event looking for mobs without a nametag will it detect the mob before it gets its name tag

sudden nest
#

Y can't lore have %? Is this intended?

warm mason
#

like %%

sudden nest
#

Ohh, wait..

#

Aw nice, thanks @warm mason

open urchin
prime zenith
#

Wait if i spawn entity then set nametag if i have entity spawn event looking for mobs without a nametag will it detect the mob before it gets its name tag

thorn flicker
#

you should be good

sudden nest
#

How do u get the translated or localization key of enchantment?

sudden nest
thorn flicker
prime zenith
#

Ok cool

1 more question

Is there a way to set players max health based on a dp in a way that wont cause current health to be effected unless it was higher then new max

warm mason
#

there will be a workaround with EntityHurtBeforeEvent

#

but it still won't work perfect

#

you could use player.json or health_boost effect

prime zenith
#

Theres a workaround now just gut and change health to a new system
But sadly health boost effect caps at 255 and effects current health

prime zenith
#

I am eager for an entityhurt before event tho cause then i can take out vanilla combat entirely and replace it with my own

#

No more hit spllater on a missed attack

#

Whens it ezpected

sudden nest
#

is it posisble to just summon a mob/entity that is considered as a projectile but just a normal mob, just to create an owner for the mob instantly without the heart particles with tame component?

prime zenith
#

Question

So i want to get a mob to display its name then under it didplay a dynamic property i have set

How would i do this

thorn flicker
prime zenith
#

Yes

thorn flicker
#
entity.nameTag = `${entity.nameTag}\n${entity.getDynamicProperty('name')}`
prime zenith
#

But its dp is set by its name

thorn flicker
#

what

prime zenith
#

Meaning i have a script setting every entities dp based on what its nameTag is

#

Actuslly that should be fine still

#

Cause its set to skip if it slready has dp

thorn flicker
#

is this a custom entity

prime zenith
#

So i just change name after its set

#

No

thorn flicker
#

nvm then

#

i was gonna suggest just intercepting the event triggered by nameable component

prime zenith
#

But the dp changes so ill just update it on change

#

Whats the syntax to kill the player or entity

thorn flicker
prime zenith
#

Ty

wicked girder
#

Can we not use debug utilities on bds?

wary edge
wicked girder
#

How so?

prime zenith
#

Monsters spawned by a script will trigger entity spawn event right

wary edge
prime zenith
#

Im an idiot

Im sitting here debugging code

I forgot to attach the event listener to main

wicked girder
prime zenith
#

Why are my entities spawning with a dynamic prpperty entityStats before i even set it and its causing my code to fail even tho i have a safety net in place thats supposed to fix it if it if its not valid

#

Wait nvm on that still got an issue tho

prime zenith
#

Ok so i have a rare but problematic bug

Occasionally an entity spawn but either derenders or disapears after event tagged it but before events ran and it causes a hard error

#

Ima put a if no entity return tag there in hopes i dont see it aby more

wicked girder
prime zenith
#

Can anyone send me the hud code that lets you hide hp food armor snd waterbreating bar

#

Ohhh i forgot they added commands for it now

prisma shard
prime zenith
#

Dont need it i forgot about the command but ty

#

I get better and better and better at script every day i have gotten nowhere in understanding json ui

unique stag
#

are debug utilities broken? cuz for some reason i am not able to use the intellisense as well, I have done

npm i @minecraft/debug-utilities@latest but all i get is

#

I am in Stable 1.21.130

unique stag
#

Bruh, it works, but intellisense is bugged??

unique stag