#Script API General

1 messages Β· Page 134 of 1

thorn flicker
#

you are acting like that gif was a political statement

thorn flicker
remote oyster
honest spear
#

the sad fact is that AI writes so abstract-less code that your abstraction actually makes the code slower

remote oyster
#

Very poetic

thorn flicker
#

aw please lets not talk about AI coding

honest spear
thorn flicker
#

its getting to the point that AI will replace everything

thorn flicker
#

no more art

honest spear
#

at least i write code that AI can't understand yet, and my friends either

thorn flicker
#

no more creativity

thorn flicker
#

just slop being fed into everyone's gullets, while people get more money from less work.

honest spear
#

when the code is so complicated than the project just dies, bc all the contributors forgot how it works in just two weeks 😭

#

not AI written btw

stray spoke
#

Is there a way to detect if the entity's inventory changes other than comparing old vs new everytick

honest spear
#

afaik we got some new inventory events lately but they are only for blocks?

stray spoke
#

Dam

thorn flicker
#

theres only an event for player currently

stray spoke
thorn flicker
honest spear
#

ohhh ok

#

i see

remote oyster
#

I don't think entities have the inventory component?

thorn flicker
honest spear
remote oyster
#

I stand corrected

stray spoke
thorn flicker
#

lol

remote oyster
honest spear
#

ohh, really

thorn flicker
honest spear
#

sorry to hear that

thorn flicker
#

well played.

#

well played.

honest spear
#

damn you got me

thorn flicker
#

bro pulled out the tumor card on my ass

remote oyster
#

LOL

honest spear
#

i felt awkward so i had to post this gift

stray spoke
stray spoke
#

Get well soon

cold grove
#

E

thorn flicker
#

tbf you didnt say cured, they can be treated obviously

honest spear
#

btw when the AI wants to take your job, good luck buddy

stray spoke
sly valve
#

yeah, I think it was called JSON overtake or something, its peak!

sly valve
stray spoke
#

Why are you still using common js

sly valve
thorn flicker
stray spoke
#

Oh right, I mean the Object prototype method

thorn flicker
#

may I be on your friends list sir

last latch
honest spear
#

You better try the OverTykes method

remote oyster
thorn flicker
#

lol

remote oyster
thorn flicker
#

ah I forgot, we both have the same setting

thorn flicker
remote oyster
#

Sent

tranquil junco
thorn flicker
#

im off to contemplate if I should sleep or stay up all day until I crash, cya

lyric kestrel
#

What is the benefit of using TS over JS for add-ons?

last latch
stray spoke
warm jungle
#

Uhh is there like pickup cooldown for .spawnItem()? if not it would be a great addition for it

distant tulip
#

There isn't
If you really need it, structures preserve the item cooldown

cyan basin
warm jungle
#

Okay! Thanks I'll try it later. Thank to you two!!

stray spoke
#

Also drop event

cold grove
#

They have listened to us

stray spoke
#

But no beforeEvent type of it

cold grove
#

Finally

#

Now remove the ai summary from the docs 🫡

worldly pier
#

they need to get the IA investor's money

stray spoke
#

How do we detect if animation stopped animating

#

It's a custom animation, I need to run a function only after the animation is finished

tranquil junco
#

the dimension gets set too

untold magnet
#

how am i going to place a block directly above the placed block?
beforeOnPlayerPlace

tranquil junco
#

i need to subclass DebugShape and then make the other subclasses inherit from it

#

this feels extremely wrong

untold magnet
#

setType cannot be called in early execution, and using system.run makes it have a delay, which make it look kinda bad

tranquil junco
#

a server-side script cannot do this

remote oyster
untold magnet
#

then ig ill have to use permutations and states to make the placed block invisible the second u place it and make it visible after placing the top block

untold magnet
tranquil junco
#

won't the game feel less responsive?

#

i don't think this solves the problem

remote oyster
# untold magnet a two blocks tall door,

What you could do, thinking outside the box here, cancel the event of the block being placed. Then use system.run() to place the other block above, and if the block which you cancelled is still required then add it right after.

untold magnet
tranquil junco
remote oyster
untold magnet
#

ill try finding a decent workaround,

tranquil junco
#

yeah but the client will still preview it

remote oyster
tranquil junco
#

yeah

#

even when playing singleplayer this is noticeable because the server only runs at 20 ticks per second

untold magnet
tranquil junco
#

i guess

#

personally i would just take the slight visual offset

remote oyster
#

20 ticks per second should be sufficient to accomplish the goal with minimum visual hiccups.

#

The code would be small and light.

#

Hardware and Internet will be the crutch though.

untold magnet
#

btw,

            if (!block?.above(1)?.isAir) e.cancel = true;
            if (dim?.id === 'minecraft:overworld' && bY?.y > 318) e.cancel = true;
            if (dim?.id === 'minecraft:nether' && bY?.y > 124) e.cancel = true;
            if (dim?.id === 'minecraft:the_end' && bY > 253) e.cancel = true;```is working pretty fine but it cancel the even when the top block is liquid (vanilla doors replaces the liquid)
And the system.run that i am using to place down the top block is not being cancelled with this, so it try placing the block there even when the event is canelled,
remote oyster
#

But that visual glitch isn't a deal breaker.

untold magnet
#

ig ill just return or soemthing

tranquil junco
untold magnet
#

also,

            system.run(() => {
                const eBlock = block?.above(1).setType('door:block');
                eBlock?.setPermutation(eBlock?.permutation.withState('minecraft:cardinal_direction', ePerm?.getState('minecraft:cardinal_direction')));
            });;```it doesnt place the block and rotate it for some reason
`permutationToPlace:ePerm`
#

it should at least place the block with the bottom block direction

untold magnet
lyric kestrel
#

@untold magnet if you're making a custom door, why not use BlockCustomComponents?

untold magnet
lyric kestrel
#

Oh

#

My apologies

#

I thought you meant the beforeEvent πŸ˜…

untold magnet
#

all i have to do now is just rotating the top block with the bottom block

lyric kestrel
#

Because you shouldn't need system.run with customComponents

untold magnet
#

only playerBreakBlockBeforeEvent exist

#

correct me if im wrong

untold magnet
subtle cove
#

Custom block component

stray spoke
#

Are you making rotatable blocks based on the player's facing

#

Cuz I don't think you need scripts if you can do it on client block directly

untold magnet
#

got it working,

#

next: breaking both blocks after mining the top of the bottom one

untold magnet
#

now all i need is instantly breaking the block the second one of the two blocks gets broken, currently it has a 1 tick delay which is killing me

wary edge
untold magnet
#

didnt even know that thing exists

#

i think i found it,

stray spoke
#

So everyone loves docs now

untold magnet
#

thanks for letting me know about that component

untold magnet
#

everything else, i make without docs,

stray spoke
#

I think that's the purpose, docs are there as starter guide

untold magnet
lyric kestrel
untold magnet
untold magnet
#

it says not registered block state

steep hamlet
#

is there a before event for sending packets?

devout sandal
#

I have a block that is getting automatically placed near the player, it’s invisible, collisionless, pickless, and unaffected by water, I am wondering if there is a good way to make it pre saturated with non source water when it is placed in non source water..? Currently when it’s placed there is a second where it is placed and the water disappears, then flows into it. Any ideas..?

tidal wasp
#

Can World Dynamic properties cause lag?

steep hamlet
devout sandal
# tidal wasp Can World Dynamic properties cause lag?

In my experience, not really. I have an addon that uses them to encode cooldown data along with location dimension and some other things on a per player basis and even with like a few hundred of them I haven’t had any problems.

tidal wasp
#

Bet

steep hamlet
#

wait... its only usable on bds isnt it sadge

#

is there a reason why they keep it to bds only

winged drift
#

all good things are only usable on bds

steep hamlet
#

ye..

tidal wasp
#

Im currently trying to make a system to use worldDynamicaProperties to store block inventories

#

And im just getting a headache just trying to formulate an object to parse into the thing 😭

#

Actually it would be as simple as

VariableName = {
maxWeight = 6400,
items = [
itemStack1,
itemStack2,
itemStack3...
]
}

#

And the name of the dynamic property is the location of the block

#

Id probably want to use ddui or JsonUI for this as well tbh

#

I dont really have a way to test anything rn because of the really annoying bug on windows rn

lyric kestrel
worldly pier
worldly pier
scarlet sable
#

yo

#

sorry for the dumb question but where can I see the API updates?

scarlet sable
#

Ty

stray spoke
#

But I like it where it saves the item stacks on cache first so we can access it directly anytime, otherwise if it's empty because of reloads, it gets the structure instead then save to cache again

#

It clones all the items and save it to the custom entity, saves the entity to structure with the specified key, then despawns it

worldly pier
#

yep, i think this is one of the best ways of storing itemStacks

#

cause i havent found anything better yet

worldly pier
#

xD

#

Do you know how to use it, right?

proud saddle
#

can scripts of different addons use exports of each other?

shy leaf
#

however there are a few ways to do it, although limited

#

such as scriptevent

lucid dust
#

anyone know when 2.6.0 comes out of beta?

unique acorn
#

most likely in the next mc update

static wedge
#

an entity in an unloaded chunk stay valid ?

weary onyx
#

Welp, I'm getting into the scriptAPI development to my first addon as well. Can someone give me advices to improve some stuffs?

distant tulip
#

learn javascript

weary onyx
#

I already know about JS and TS. I mean, how to start about the scripting on here

#

I tried to make one by scratch, but the bridge app just allows me work with 1.0.0 of @minecraft/server or betas

weary onyx
#

so, bridge doesn't works well for this nowadays?

wary edge
lucid dust
#

what's the best way to get the coordinates a certain distance ahead of where a player is looking?

weary onyx
#

When i work with bridge (only for behavior pack), doesn't appears

static wedge
# warm mason no

really ? because with logs, I noticed that an entity can remain valid even if the chunk is not loaded

#

but when I change dimension or reload all, the entity becomes invalid

warm mason
drowsy scaffold
#

Obviously you need to format it to vector3 but just generally speaking

last latch
subtle cove
#

the update be trollin hard ;-;

wary edge
#

Is there an easy way to know what parts of your scripts uses beta APIs?

warm mason
jolly junco
#

Is there any way to programmatically get the translated text of action bar item names?

distant tulip
#

you can get the translation key and use it
but you can't know the content of the text

jolly junco
#

I see, thanks

buoyant canopy
#

is there an automated way to get all the generated chunks in the world?

cinder shadow
turbid delta
#

Fixed EntityHurtBeforeEvent.cancel to not allow some sources of knockback (sprint bonus, enchantment, mace smash, projectiles) when set to true

#

Life is good guys

turbid delta
#

Nevermind they fully messed up the knockback

worldly pier
#

average minecraft scripts developer experience:

wary edge
#

Just use onPlayerInteract custom component.

solar dagger
wary edge
#

What are you trying to achieve.

solar dagger
wary edge
#

And why does that require cancelling interaction. Bulk craft isn't descriptive.

solar dagger
#

dont matter, ill figure it out.

summer cloud
#

Im creating a custom bot via gameTest simulated player, but i have a issue where the attackEntity(target) module dosent do anything, it plays a swing animation, but no damage, screen shake, or any related events apply. Why does this happen? and how do i fix it? and no effects are applied

summer cloud
summer cloud
worldly pier
#

did you use the beta api?

cursive fog
#

How do you stop a play animation from running?

median geyser
#

I usually just play a small animation on top of that one to stop it from running

stray spoke
#

I made some gui change detector

#

But it's not very performance friendly

#

Since there's no events for detecting inventory changes for other entities nor blocks, I had to use system.runInterval for it

#

And an option to start or stop to avoid gc

untold magnet
knotty plaza
stray spoke
#

Oh yeah that's from startup event right?

untold magnet
knotty plaza
#

I think the entity just saves the block's position

#

And runs the event on whatever block is there

naive frost
#

99998

#

99999

#

100000th msg

zinc breach
#

if I put some code to run in a system.runTimeout after say 10 seconds but close the world before it happens, will it keep track of that and run even when I reopen the world or would it act like that never existed

#

and I assume the same thing applies to realms/servers crashing or closing right

zinc breach
#

could I save the entity id in a dynamic property then do world.getEntity()

snow knoll
#

You could, but I'd need more context to see if that works for you

zinc breach
#

so I would have to clear them or they would awkwardly sit there

naive frost
zinc breach
#

and you would put the id in the dynamic property anywhere you spawn it

#

as an array

naive frost
#

Ooh

weary onyx
#

guys, if i already placed a chest when my function worked propertly, how do i inject my custom loot on it?

worldly pier
worldly pier
zinc breach
worldly pier
zinc breach
last latch
#

What about system.job/run?

thorn flicker
#

my content logs are turned off from updating

last latch
thorn flicker
#

this never happened.

#

I should've remembered

#

jesus

cinder shadow
#

yet another thing that will randomly get reset whenever a new update comes out πŸ˜”

#

Skins, Render distance, now content logs??

thorn flicker
#

only my sneaking keybind and content logs

cinder shadow
#

I load into a world and all of a sudden my fans kick into high gear

#

First thing I check is render distance

thorn flicker
#

why does it change it to that high though

#

makes no sense

cinder shadow
#

who knows, my custom skins haven't really worked in stable for several months now either

#

defaults me to an Alex skin or one of the other generics for everyone but me

thorn flicker
#

i think I got my skin reset only like once

worldly pier
zinc breach
zinc breach
stray spoke
#

Oh like an auto cleanup system

#

Clearing dropped items and other stuff

#

That's actually very common on servers

#

Oh nvm its diff

worldly pier
#

that way you dont have to run something every tick

gray mica
#

Hello there

#

Is it possible to change villagers trades dynamically?

cold grove
gray mica
#

So ?

#

Not possible

cold grove
#

I said no

gray mica
#

No workaround?

cold grove
#

I mean yes sorry

gray mica
#

πŸ«ͺ

#

I am confused rn

cold grove
#

You should have component groups for each economy table

gray mica
#

Oh and trigger the event ?

cold grove
#

Yes

gray mica
#

Ok thx

#

Another question

#

Is it possible to wire json ui to script api ?

#

Wha!?

cold grove
gray mica
#

Oh , i mean wire like connect to each other

#

Making communication to change ui dynamically

cold grove
gray mica
#

What if so many titles in the same time ?

#
  • action bar won't it get like overridden by others , like if an add-on is already using it , won't it make it invisible or glitchy or something
subtle cove
#

Depends on addon priority

cold grove
alpine wigeon
#

ok so I have a vector3 direction but need to convert it to a vector2 rotation for the player

does anyone know how to do that?

gray mica
#

Yes

#

Just remove the Y

#

And you get the rotation on x , z axis

alpine wigeon
#

uh

#

that's not what i meant

#

at least i think

cold grove
#

I deleted it because it was not correct sorry

gray mica
#

You have direction and you want rotation

alpine wigeon
#

yes

alpine wigeon
gray mica
#

and what the difference between em

stray spoke
#

You can use @minecraft/math's Vector3Utils and Vector2Utils for that

alpine wigeon
#

not sure if this clarifies at all but im looking for x, y

alpine wigeon
stray spoke
#

You can do npm i @minecraft/math

#

It gives you tools to handle vectors operations but depends on you how you use it

alpine wigeon
#

i dont think the vector3utils has what i'm looking for

stray spoke
#
function dirToRotation(dir) {
  const { x, y, z } = dir;

  const yaw = Math.atan2(-x, z) * (180 / Math.PI);
  const pitch = Math.asin(y / Math.sqrt(x*x + y*y + z*z)) * (180 / Math.PI);

  return { x: pitch, y: yaw };
}
alpine wigeon
#

tysm bro

stray spoke
#

Not sure if this works fine

#

But try it

alpine wigeon
#

hmmm the x rotation is just returning 0

#

oh wait the values were swapped

stray spoke
#

If dir.y is always under 0

#

it will return 0

alpine wigeon
#

so now i have the values but i'm trying to use setRotation() and it seems to not work

#

at all

cold grove
#

i can't remember if player rotation is 360 or -180, 180

stray spoke
#

Are you using getViewDirection for vector3

alpine wigeon
#

no i'm using the distance from the player to a spruce_log

#

i'm trying to move the player towards the tree and face them towards it also

stray spoke
#

Oh

#

You might need 3d delta

#

Wait I'll try

alpine wigeon
#

well i got it working using runCommand with tp rotation but that's not optimal

stray spoke
#
const playerPos = player.location;

// Idk if this is the correct api to get the center vector3 location of the block
const blockPos = block.center

const dir = {
  x: blockPos.x - playerPos.x,
  y: blockPos.y - playerPos.y,
  z: blockPos.z - playerPos.z
};
function dirToRotation(dir) {
  const { x, y, z } = dir;
  
  const yaw = Math.atan2(-x, z) * (180 / Math.PI);

  const horizontal = Math.sqrt(x*x + z*z);
  const pitch = Math.atan2(y, horizontal) * (180 / Math.PI);

  return { x: pitch, y: yaw };
}
#

This was about moving the player to block

alpine wigeon
#

ok

#

ill try that

stray spoke
#

That's all I can try to help

#

Gtg

alpine wigeon
#

ty

#

im tryinna make minecraft play itself

#

:)

zinc breach
#

its a system.run not system.runInterval

#

this runs only when the script is reloaded

stray spoke
#

Do yall have docs for websocket communication

#

I tried this but it didn't work now

crude ferry
#
world.beforeEvents.playerBreakBlock.subscribe((e)=> {
    if (running !== true) {
        return;
    }
    e.cancel = true;
})```
Any way to get the location of the broken block?
crude ferry
#

Thanks!

#

I was looking for it in the wrong place.

light sluice
#

is there any way to detect if the player is pressing a button other than jump or sneak???

gray mica
#

Is it possible to communicate with json with scriptevent or scoreboards , but the scoreboard must be invisible?

stray spoke
gray mica
#

Yes

stray spoke
#

I saw a post about chat channels, clicking button makes it send a chat, then in the backend it detects the message using chatSend event

crude ferry
#

Is there a way to detect key presses though?

stray spoke
crude ferry
#

Yeah expected.

#

On a BDS?

stray spoke
#

I haven't tried bds, but I think it's just the same

crude ferry
#

I see.

stray spoke
#

Obviously, there's no script in json ui

gray mica
#

So

stray spoke
#

I think the send message way only

gray mica
#

Ahhh

#

Unfortunately

#

What if my UIs using more than one variable

stray spoke
#

You can conditionally render in json ui instead

light sluice
stray spoke
#

Ohh, I dont think there is, but there's swing event

#

But only for swinging hands like clicking anything, interacting, etc.

gray mica
stray spoke
#

For example if the title has a prefix like "Β§e", it will show the json ui element

#

Otherwise it won't display

gray mica
#

Oh for the scoreboard you mean ?

stray spoke
#

What are you trying to make

gray mica
#

So i am making this ui which
Is a pop-up , like it appears when something happens

#

And i am currently having two

#

That may pop-up in the same time

#

And trying to find a way to do that

#

Because when one appeares other disappears

#

But i want both to appear same time

#

And i am trying to add a third one too

#

And i have no idea to what to use to make it work

worldly pier
#

whats the best way to store information in a block? it can be a custom block

knotty plaza
lyric kestrel
cold grove
#

Seomeone tested if Math.hypot is less optimized here?

honest spear
#

Is there way how we can get block drops for specific item or not? Afaik there was something in changelog long time ago, but now i can't see the apis

#

Ohh i can see it its under loot tables i see

round bone
#

Stick to it, do not care about performance as it's implemented in core engine anyways

golden holly
#

how do I refrence other files?

#

i did import { myFunction} from './file.js'
but it says it cannot fiind file js

last latch
gray mica
#

@last latch can u help me please

last latch
round bone
last latch
#

I love these questions

cold grove
cold grove
worldly pier
round bone
gray mica
#

I am using hud_title

#

And 4 images elements

#

But when i override the title using /title command some elements disappear

cold grove
#

You should ask there

#

#1067869374410657962

gray mica
#

Ok

gray mica
round bone
distant tulip
#

no one is answering questions like that anyway, if you don't have specific question don't expect any reply

woven loom
#

HowCan i try it

distant tulip
woven loom
#

Oh

gray mica
distant tulip
#

well, how do you expect to get help

gray mica
#

I was trying to make 3 system , but when i override title elements just disappear

distant tulip
gray mica
#

Ohmm k

sage portal
#

do runTimeouts tick values stack? I want to add a runTimeout in a runTimeout

#

basically, would the second runTimeout occur at the third tick, or the fifth tick?

system.runTimeout(()=>{
  //other code
  system.runTimeout(()=>{
    //stacked timeout code
  },3)
},2)
unique acorn
last latch
#

5th. (totally not late)

sage portal
#

alr, thanks fellas πŸ‘

marble spruce
#

Yo guys,do i can set double tags like this

        if (player.hasTag("mutant,mutant2"))```

or like this 
```js
        if (player.hasTag("mutant || mutant2")) {```
wary edge
#

hasTag(tag1) || hasTag(tag2)

marble spruce
#

Ah okk thanks!

warm mason
# marble spruce Yo guys,do i can set double tags like this ```js if (player.hasTag("muta...

hasTag is a method of Entity class. Players are also entities, so all the methods of Entity class are also available in Player class. Entity.hasTag("test_tag") returns a Boolean value depending on whether the entity has the exact tag you specified ("test_tag" in this case). If you want to check for the presence of one of tags, you need to use two methods and the || (or) operator. And when you type player.hasTag("mutant || mutant2") you are checking if the player has the tag "mutant || mutant2" and not if he has "mutant" or "mutant2".

The same thing happens with other methods, functions, and operators. For example, you can't do if (test == 1 || 2) {}, you need to do if (test == 1 || test == 2) {}

I decided to explain this because it is the basis of JavaScript itself and not the specifics of this method.

marble spruce
chrome coyote
stray spoke
#

That's smart

#

Thanks for the idea

lyric kestrel
stray spoke
#

Yes, that avoids itterating or whatever they call it

sly valve
# chrome coyote if you want to make it shorter (just to make it more visibly clear) ```js const...

and optional if you or someone prefers for-loops


/**
 * @param {Entity} entity 
 * @param {...string} tags 
 * @returns {string | undefined} returns the first found tag of input tags or undefined
 */
function hasEntityAnyTag(entity, ...tags) {
  for (const tag of tags) {
    if (entity.hasTag(tag)) {
      return tag; // you can also just: return true
    }
  }

  // and here: return false
}

/**
 * @param {Entity} entity 
 * @param {...string} tags 
 * @returns {boolean}
 */
function hasEntityAllTag(entity, ...tags) {
  for (const tag of tags) {
    if (!entity.hasTag(tag)) {
      return false;
    }
  }

  return true;
}
#

but I think for short stuff Array methods are fine enough (some, filter, every and e.t.c)

#

I'd only prefer or recommend using for/in-loops when you need perfomance or control over your loop and what happens

knotty plaza
sly valve
#

and now it shall be overoptimized!!! we need a Cache!!!!!!

stray spoke
#

Y'all are making it complicated 😭

sly valve
stray spoke
#

for loop is fast tho

lyric kestrel
#

Yeah, but there's no need for it πŸ₯²

#

Especially with what he's doing

sly valve
#

we should actually write it in bin for the performance

lyric kestrel
#

Maybe if the project was big, but it just seems like a small project

lyric kestrel
sly valve
#

s-size doesnt matter!

#

but yeah when you have the ability to make it more performant, use it.
no one wants to see:

for (const i in searchTags) {
  const entityTags = entity.getTags();
  if (entityTags.include(searchTags[i])) return true
}
robust pivot
#

Does entityHurt beforeEvents ignore the invulnerability timer?

shy leaf
#

kinda need more details

robust pivot
sly valve
shy leaf
#

since timer runs when it actually takes damage

robust pivot
#

I must've messed it up royally, then. It applies continuously decrementing damage each tick until the game(I assume) just rounds it to zero

knotty plaza
sly valve
knotty plaza
sly valve
knotty plaza
sly valve
#

way too unefficient as well

knotty plaza
#

Let's make one with 0-1-2

sly valve
#

why thinkinh in "numbers"

#

when we can be way more smarter~

knotty plaza
#

It would need to be powered with electricity2

gray mica
#

Electricity 2

worldly pier
#

guys, guys, guys,.We are not thinking outside the box. We need something more original

shy leaf
sly valve
#

our PC, the whole thing, will be working in 6 or 7 different dimensions

#

why thinking in numbers... I meant β™  or βœ—

worldly pier
#

lets use proteins instead of bits

#

that way we can create a living pc

sly valve
#

and we shall let evolution decide our CPU architecture

#

basically like training a LLM to generate wonders

gray mica
#

I have better idea

knotty plaza
#

You guys are going for low level stuff

#

We need to connect our brains to a machine and run the game there

last latch
#

this channel became the new off-topic lmao

knotty plaza
robust pivot
sly valve
sly valve
stray spoke
#

Oh yeah we can't do O(1)

gray mica
#

Is it possible to make an entity avoid player dynamically?

stray spoke
#

In client entities it's possible, like filtering if the entity is a member of a certain family or if it has a tag

gray mica
#

Noice

stray spoke
#

oh

thorn flicker
#

you said client entities

#

lol

gray mica
#

Guys question

thorn flicker
gray mica
#

Yello

#

Find u ?

thorn flicker
gray mica
#

Dine n u ?

#

Fine and u

stray spoke
#

Lmao

thorn flicker
#

huh

gray mica
#

Hmm is there like an add-on studio like small group of people that works on add-on together?

distant tulip
#

i would assume so...

gray mica
#

That make it for the love of the game...

distant tulip
#

ah, no
we all work in add-ons out of greed

gray mica
#

: T greed of what ?

crude ferry
cobalt gorge
#

Is it possible to set the ItemStack data ID? I want to set the meaning of 14 below on the ItemStack

e.g. /give <player> red_mushroom_block 1 14

sly valve
#

Just change the argument provided at drop.itemId to change the items ID

cobalt gorge
cobalt gorge
#

I have come up with a workaround using loot tables & loot spawn though!

sly valve
#

Hmm... Only thing I know you can set are dynamic properties, properties, tags? And components

last latch
#

😭 ✌️ 10926thumbsupmeme

gray mica
#

Money in this economy ?

sly valve
#

Someone has money?

naive frost
#

Where did money go

sly valve
worldly pier
drowsy scaffold
#

Can you set a fishing hook to be hooked onto a target?

lyric kestrel
#

All the dozens of warnings the trial and errors

#

😫

distant tulip
#

-# got this in DM

cold grove
weary umbra
supple perch
#

damn

distant tulip
#

yeah

cold grove
supple perch
#

honestly super confusing ngl

#

it'd be better to document javascript

cold grove
#

Someone make a nodes tool

distant tulip
supple perch
#

legit just straight up abstracting something that is already abstract to some level

#

like javascript is a high level language

#

we don't need another language ontop of it

cold grove
#

Lol

supple perch
#

the only issue is if they're not realistic about it

#

yo btw does anyone here use Visual Studio?

#

i use Visual Studio Code

#

i'm just wondering what are your thoughts on VS compared to VSC

#

especially for writing scripts and addons

distant tulip
#

to each there own use, they are different for a direct comparison

supple perch
#

but i'm asking

#

in general

worldly pier
#

its not that hard to write if()

weary onyx
#

guys, how can i make that the webs can be separated and spread to other parts of the inventory?

#

i mean, like this

chrome coyote
weary onyx
#

in java edition was easy to put it randomly, but bedrock doesn't works propertly i guess

stray spoke
weary onyx
#

nope, i'm just using the simple /loot command after placing the chest

snow jungle
weary onyx
#

nvm, i saw the problem

#

😹

#

instead "replace" i put "load"

#

now it works

stray spoke
#

Looking nice

weary onyx
#

I'm making a kind of COD:Zombies but in minecraft

#

I'm doing some airdrops chests

remote oyster
# supple perch i'm just wondering what are your thoughts on VS compared to VSC

I use both, but I mainly stick to VSC because it’s lightweight yet very efficient. For Minecraft Bedrock behavior packs and addons, I don’t really need a full IDE like Visual Studio. VSC gives me everything I need such as syntax highlighting, IntelliSense for JavaScript/TypeScript, and easy integration with JSON and scripting files, which are core for Bedrock addons.

Another big advantage is its cross platform support, I can switch between Windows and Linux seamlessly, which keeps my workflow flexible. Plus, the vast ecosystem of extensions in VSC makes things like code formatting, linting, and even Bedrock specific tools much easier to set up than in full Visual Studio.

For debugging, VSC has good support for scripts and can integrate with Minecraft addon projects via tasks or launch configurations, whereas Visual Studio can be overkill unless you’re doing complex C++ modding. Overall, for Bedrock scripting, VSC hits the sweet spot between functionality and simplicity and that's what I personally favor.

zinc breach
#

like is there a way to make a player swing an item through script api

zinc breach
snow knoll
zinc breach
#

like I cant access that?

snow knoll
#

The animation is not avaliable to us due to its lack of existence
It means its not accessible in the style of a JSON file, and is written into the actual game's code

worldly pier
rough elm
#

Wspppp

gray mica
#

Guys

worldly pier
#

Guys

lyric kestrel
#

Guys

dapper copper
#

Guys

buoyant canopy
#

what have i just created?

worldly pier
gray mica
#

The best of all is O(n!)

buoyant canopy
#

may I know where exactly am i doing a o(nΒ²) ?

stray spoke
#

Do y'all know a way to keep the entity that has viewable inventory from dropping those items on death

buoyant canopy
#

there is a property in minecraft:inventory component that makes the entity's inventory private, but i don't know if it works of the inventory is viewable

stray spoke
#

I tried that but that also makes inventory unviewable

buoyant canopy
gray mica
remote oyster
# worldly pier its perfect, its peak code, It even has O(nΒ²)
/**
 * Maximum-performance 3x3 chunk scanner.
 * Fully unrolled + numeric hashes + no allocations.
 *
 * @param {{x:number,z:number}} location - World coordinates
 * @param {Set<number>} chunks - Set of processed chunks
 */
function scanChunks(location, chunks) {
  const baseX = Math.floor(location.x / 16);
  const baseZ = Math.floor(location.z / 16);

  // Unrolled loop: manually handle each neighbor
  const hash00 = ((baseX - 1) << 16) ^ ((baseZ - 1) & 0xffff);
  if (!chunks.has(hash00)) chunks.add(hash00);

  const hash01 = ((baseX) << 16) ^ ((baseZ - 1) & 0xffff);
  if (!chunks.has(hash01)) chunks.add(hash01);

  const hash02 = ((baseX + 1) << 16) ^ ((baseZ - 1) & 0xffff);
  if (!chunks.has(hash02)) chunks.add(hash02);

  const hash10 = ((baseX - 1) << 16) ^ (baseZ & 0xffff);
  if (!chunks.has(hash10)) chunks.add(hash10);

  const hash11 = ((baseX) << 16) ^ (baseZ & 0xffff);
  if (!chunks.has(hash11)) chunks.add(hash11);

  const hash12 = ((baseX + 1) << 16) ^ (baseZ & 0xffff);
  if (!chunks.has(hash12)) chunks.add(hash12);

  const hash20 = ((baseX - 1) << 16) ^ ((baseZ + 1) & 0xffff);
  if (!chunks.has(hash20)) chunks.add(hash20);

  const hash21 = ((baseX) << 16) ^ ((baseZ + 1) & 0xffff);
  if (!chunks.has(hash21)) chunks.add(hash21);

  const hash22 = ((baseX + 1) << 16) ^ ((baseZ + 1) & 0xffff);
  if (!chunks.has(hash22)) chunks.add(hash22);
}

Do you approve? πŸ‘€πŸ™πŸ«ͺπŸ«£πŸ˜΅β€πŸ’«

worldly pier
#

Bro what

remote oyster
#

It's beautiful art

#

Lol

#

I also need to get some sleep 😁

worldly pier
#

wrong it has no cache

#

😠

#

what if i tried calling this function 10^32 times in a single tick

worldly pier
remote oyster
gray mica
worldly pier
#

mine not. Cloude's test servers yes

#

ill ask it to vibe code the funcion to make it 100% better

remote oyster
#

🫣

last latch
stray spoke
#

Anyways, is there example snippets for custom form

last latch
buoyant canopy
rich jacinth
#

What are the limits to the ticking area manager? I've worked with the ticking area command for a while now but am switching over due to the manager being in stable now, and my major question is just what are the differences?

buoyant canopy
#

none?

rich jacinth
#

Oh?

buoyant canopy
#

the change log says they aren't limited

last latch
rich jacinth
#

Got it

#

Thank you :D

subtle cove
subtle cove
sly valve
gray mica
#

Huh ? Do you meanO ((n!)!)

#

Because n!! < n!

#

For each n > 2

worldly pier
#

im curious, is there an n less than 1 such that:
n!!>n! is true?

gray mica
#

:-:

#

Yes

#

only in a very limited sense, and it depends on how you define the double factorial for non-integers.

worldly pier
#

interesting

misty dagger
#

Another day, another painfully replacing mc.EntityComponentTypes.Equippable with runCommand("replaceitem ...")

misty dagger
#

Thank the Lord I only need write access. No reading is necessary for this project.

supple perch
#

they should add entity equippable component back to entities

supple perch
#

but it's very limited

#

compared to just... getting the slot

misty dagger
#

Tell me the method for future reference.

supple perch
#

you'll have to use runCommand + testfor command

#

with the hasitem selector

#

and then check successCount === 1 (success)

knotty plaza
supple perch
#

but for my use case i only need to check for two items

#

you'll basically have to implement something similar

#

except for each slot you wanna check instead of the enderchest slot

#

and yes i am aware of the enderchest component being added to the new versions

#

anyway gtg cya

misty dagger
cursive fog
#

Anyways to detect left click using scripts?

uncut sail
#

Can someone give me a code that shows TPS in the player’s action bar?

snow knoll
buoyant canopy
snow knoll
thorn flicker
#

there's also a swingSource property for it now

tidal terrace
#
const entity = dimension.getEntities({
    type: 'minecraft:item',
    location: block.location,
    maxDistance: 5,
    closest: 1
})[0]
if (!entity?.isValid) return

const item = entity.getComponent('minecraft:item') as EntityItemComponent
if (!item) return

item.itemStack.amount++
#

What is the problem?

lyric kestrel
tidal terrace
#

Nothing is showing up

lyric kestrel
#

Do you have content log on?

tidal terrace
#

yes

tidal terrace
lyric kestrel
#

Ah, I see what you're doing. `item.itemStack.amount++ isn't actually increasing

tidal terrace
#

yes

lyric kestrel
#

You're not setting the new itemStack

tidal terrace
#

What should I do?

#

Summon the entity again?

lyric kestrel
#

Give me 5mins to get home.
But in the mean time try doing new itemStack()

tidal terrace
#

yes

lyric kestrel
#

Wait, so what exactly are you trying to do?

#

Are you trying to increment the player's selected hand, or what are you doing?

wary edge
#

If you read the code, they're trying to increase an item entity.

lyric kestrel
#

Oh. Sorry, got a little confused

stoic coral
#

itemCompleteUse is deprecated ?

tidal terrace
lyric kestrel
#

Ok, I can't help you when I get home. I'm needed to do something else, sorry

wary edge
tidal terrace
wary edge
#

Ah right, it's readonly that's why.

tidal terrace
#

Yes, that seems to be the problem.

wary edge
#

I would use before item pick up event.

#

Read the item, cancel the event, remove the entity and then add the new item to the inventory.

stoic coral
tidal terrace
#

I used that feature to increase the number of items dropped when a block is broken to two.

#

Does the approach of deleting an entity and creating a new one seem okay?

wary edge
#

Yewah.

tidal terrace
#

I have resolved the issue. Thanks to everyone who helped me

hybrid island
#

how to spawn a entity with a tag?

gray mica
#

Guys you are pro at js right

#

So i am making a system, in Minecraft must i put it in all-static class ?

#

Or instantaneous class

sharp elbow
#

And that depends on the programming style too. You do not need to use a class if you do not want to

gray mica
gray mica
gray mica
warm mason
warm mason
remote oyster
#

In reference to a class, I made a comment on this not long ago in the #off-topic channel where someone asked when is it relevant. Will post it here for reference.

#off-topic message

gray mica
#

Btw is there an event for worldSavesDataEvent ?

warm mason
# gray mica Yes

Then think about what to use. There are no rules that tell you whether to use static methods or not. Just think about what will work best

warm mason
gray mica
gray mica
sharp elbow
#

But yeah seems like you get it

gray mica
#

I mean : v

#
  • like it s a one time thing
sharp elbow
sharp elbow
#

Ah, gotcha. Like attributes, health

gray mica
#

Yeah

#

Attributes

#

But each attribute changes how the game behaves with you

sharp elbow
#

I suppose class would be the way to go, since you do want to track state

gray mica
#

Ok , but what about the methods inside must they be static ?

#

Like i don't want it to be instantiated for each player

#

Because it s like a global thing.

#

Because i use dynamic Properties and Tags

#

Is that the best option to stick with ?

sharp elbow
#

Well, why not? While all players have mana, each player should manage their own mana. Having each player instance wrap their own mana class instance means you can write non-static methods to operate on one unit of data at a timeβ€”it showcases your intent more clearly IMO

worldly pier
worldly pier
gray mica
hybrid island
worldly pier
#

you get a lot of control

gray mica
#

Hmmm, i see

worldly pier
#

like:
CustomPlayer {
constructor(player:Player) {
this.getMana()

....
} }

Its called dependency inversion or something similar

gray mica
#

Another question, about the events

worldly pier
#

also the Player.constructor is protected

#

that means you can't extend it

sharp elbow
#

I would follow a pattern kinda like this. Curious to get the room's thoughts

const DEFAULT_MANA = 10;

class Mana {
  constructor(player) {
    this.saveKey = `project:mana_${player.id}`;
    this.value = this.getStoredValue();
  }
  getStoredValue() {
    return world.getDynamicProperty(this.saveKey) ?? DEFAULT_MANA;
  }
  consume(value) {
    // Operate on this.value
  }
}

// Initialize property on players
Object.defineProperty(Player.prototype, "mana", {value: undefined});

// Define property on load
world.afterEvents.playerSpawn.subscribe((arg) => {
  if (arg.initialSpawn) {
    arg.player.mana = new Mana();
  }
});
wary edge
#

You can override the prototype no? Or extend it, that's how I use Block and Entity methods.

gray mica
worldly pier
sharp elbow
#

If you would like to operate on data stored within the class, then methods inside the class would be the most clear way. Not writing methods in the class for that eliminates the advantages of using a class

gray mica
#

Yeah but when using em in
index.js as example

#

Must i rewrite them in each event ?

tidal terrace
#

Is there a way to play the animation that appears when the player attacks?

worldly pier
gray mica
#

Like
World.event.x.subscibe(e => {
StatusSystem.EventEvnt(e);
})

worldly pier
gray mica
#

So, when i write my event inside my class

#

It won't work until i call them in a real event

#

Right?

worldly pier
#

yep

gray mica
#

There isn't a better way to do it ? , i mean just create my event inside a class and it is called automatically

worldly pier
#

If you want to attach it to another event

sharp elbow
#

This is sounding like a question about separation of concerns. You have these outside system (your "events") that interface with a player's mana in some way, and you have the means of storing mana itself. They depend on each other, but they only communicate with each other; IMO they should not be closely interwoven.
Like, let's say you have a magic fireball staff that needs to read mana and consume mana. If you follow a pattern similar to what I showed, you can implement methods for reading/writing mana in the Mana class. But I would not add a "shoot fireball" method to the Mana class; that seemingly falls outside of the sphere that the Mana class cares about

gray mica
#

Hmm i see

sharp elbow
#

You certainly could make a "shoot fireball" method on such a Mana class, there's no limitation saying you cannot. At that point it is more of a code organization problem

#

Which, if that is your preference to do so, by all means go for it. The most important thing is to write code you can come back to after a few months and readily understand what it is doing

#

(Which reminds me, I have some refactoring to do)

gray mica
#

Yeah i gotcha, thx

remote oyster
weary onyx
#

anyone knows about making a custom itemGroup?

#

like ```
Flare guns

  • Resource Flare Gun
  • Potions Flare Gun
    ...
open urchin
#

not sure what that has to do with scripting but there's documentation here https://wiki.bedrock.dev/items/item-catalog

worldly pier
weary onyx
open urchin
weary onyx
#

a

gray mica
#

class statusSystem { event1( ev : playerBreakBlock) {} event2(ev: playerBreakBlock) }

#

world...playerBreakBlock.subscribe(e => { event1(e) ; event2(e) } )

#

i don't want each time i write new method , to call it manually

#

@sharp elbow do you know how to do that ?

sharp elbow
#

I suppose you could put a statusSystem instance on each player, similar to the Mana class example I gave. Then you could invoke the methods of statusSystem by accessing them on the player.

// initialize status system instance
world.afterEvents.playerSpawn.subscribe((e) => {
  if (e.initialSpawn) {
    e.player.statusSystem = new statusSystem();
  }
});

// Events
world.afterEvents.playerBreakBlock.subscribe((e) => {
  e.player.statusSystem.event1(e);
  e.player.statusSystem.event2(e);
});
gray mica
#

no i meant u see e.player.statusSystem.event1 , 2 i don't want to write them every time i want something like this statusSystem.events(ev)

#

and whenever i add new method it auto add it to the code

sharp elbow
#

Ah, gotcha. Then sure, you could add a method to your statusSystem that invokes other methods with the same parameter

#
class statusSystem {
  constructor() {}
  events(e) {
    this.event1(e);
    this.event2(e);
    // ...
  }
  event1(e) { /* ... */ }
  event2(e) { /* ... */ }
}
#

And it should be safe as long as you aren't mutating the event object in some way. Like doing delete e.player or similar

gray mica
sharp elbow
#

You could use an instanceof check to guard to specific event responses, I suppose

gray mica
#

ok thank that what i wanted

sharp elbow
#

But I think I found an even better, less explicit way to do what you've asked. Instead of manually invoking this.event1 etc., you could populate an array with callbacks to your events, then loop over the array.

class statusSystem {
  responses = [
    // Example callback
    (e) => console.warn(e.player.name)
  ];
  constructor() {}
  events(e) {
    responses.forEach(cb => cb(e));
  }
  pushResponse(cb) {
    this.responses.push(cb);
  }
}
#

Just need to be careful about knowing where that callback is defined (so you know where to debug later), and to be careful about underestimating the implications of more declarative code like this (less code β‰  performant code, the array could have hundreds of entries)

worldly pier
#

yep, something you have to take in account is that here you are applying the DRY(dont repeat yourself) rule, this can make things complicated, because it sacrifices granular code for less code

ripe dune
#

i remember that the last time I tested it, time was still saved even after restarting the world

gray mica
#

Vibe coding

copper quartz
#

Should i do json ui or script as my first menu?

gray mica
#

Guys is it possible to make cinematic cur-scenes in Minecraft ?

wary edge
#

Yes. Use the Camera APIs.

gray mica
#
  • is it possible to change fog dynamically in Minecraft?
cold grove
dapper copper
cold grove
#

Idk..

dapper copper
#

me neither

cold grove
#

Ne meither?

dapper copper
cold grove
# gray mica + is it possible to change fog dynamically in Minecraft?
import { Player } from "@minecraft/server";

/**
 * Proxy to ineract with the Fog Command Layer of active fog stack of a player 
 */
export default class Fog {
    player: Player;
    private stacks: { [id: string]: string[] } = {};

    constructor(player: Player) {
        this.player = player;

    }

    /**
     * Pushes a new fog setting onto the top of the Fog Command layers of the players' active fog stacks.
     * @param userProvidedId 
     * @param fogSettingId 
     */
    push(userProvidedId: string, fogSettingId: string) {
        this.player.runCommand(`fog "${this.player.name}" push ${fogSettingId} ${userProvidedId}`);

        (this.stacks[userProvidedId] ??= []).unshift(fogSettingId);

    }

    /**
     * Removes the top-most fog setting that matches the user provided ID (i.e. as provided previously via a {@link FogProxy.push} command)
     * @param userProvidedId 
     * @returns The removed fog setting ID. undefined  is returned if the command layer stack or the cache are empty
     */
    pop(userProvidedId: string): string | undefined {
        this.player.runCommand(`fog "${this.player.name}" pop ${userProvidedId}`);

        return (this.stacks[userProvidedId] ??= []).shift();

    }

    /**
     * Removes all matching fog settings, that matches he user provided ID (i.e. as provided previously via ore or more {@link FogProxy.push} commands)
     * @param userProvidedId 
     */
    remove(userProvidedId: string) {
        this.player.runCommand(`fog "${this.player.name}" remove ${userProvidedId}`);
        delete this.stacks[userProvidedId];

    }
}
uncut sail
#

Can someone give me a code that shows TPS in the player’s action bar?

meager pulsar
cold grove
#

You have to create a "build" of your code that combines those libraries with your code

#

If you use TS is already there

meager pulsar
meager pulsar
#

thx

summer cloud
#

I have a issue, im trying to add support to blurry's java combat 1.0.8 to be able to handle simulated players, the issue is if it runs like world.getAllPlayers() any bot shows as undefined, while in my script they show as like "bot" why does this happen? and i did update blurry's manifest to have the gametest dependency.

random flint
summer cloud
#

i lowky just copied blurry's files into my pack, so now it works fine, and if i post a public version ill just say its not compatable with blurry's and remove those files

gray mica
#

Guys how to check if player is in a village, and if it is it get tagged with this "in_village"

random flint
#

A village can either mean the "structure" or the "state" where a group of villagers collectively agreed a bed and a workstation nearby is a village.

You could technically do the environment sensor to test in_village test

gray mica
#

Is it possible on players ?

#

I mean player's json ?

random flint
# gray mica I mean player's json ?

yea, if I remember, the player vanilla json environmental sensor is used exactly as that. Detecting if the player is in a village to trigger a Raid

gray mica
#

Oh ok thanks

#

So technically saying you can trigger an event with it

native orchid
#

getTopmostBlock() doesn't work on transparent blocks?

honest spear
honest spear
cold grove
#

Have you ever tried this one?

spice finch
#

If I want to store a Boolean on any entity to check later, which one is faster when used a lot. Scoreboard, tags, or dynamic property?

shy leaf
#

scoreboard is overkill if its disposable

#

and dynamic property is the least headache inducing stuff

#

i honestly would use dynamic property over anything because of how much control i have compared to any other methods

spice finch
#

Thanks!

dapper copper
sharp elbow
honest spear
honest spear
#

but here is the limit of how TS could check the types as it doesn't properly defines the behavior of super keyword anway

#

I think i have update method somewhere as well let me check

sharp elbow
#

Why have the second parameter inherit from a clone (of depth 1?) of the prototype instead of the prototype directly?

honest spear
#

its just for that little feature for the super keyword

sharp elbow
#

Ah, it is for safety.

honest spear
#

Hmm not sure, wdym

#

safety of what?

#

or more like safety from what?

#

this exaples shows how it works

OverTakesJS(Player.prototype, {
  sendMessage(...messages){
      if(messages.length === 1) 
        super.sendMessage(typeof messages[0] === "object"? messages[0]:(messages[0] + ""))
      else super.sendMessage(messages.join(" "));
  }
});
#

so you can access sendMessage without calling your self, basically calling the original one

#

via the super reference

sharp elbow
#

If I overwrote a sister method like getRotation, super.getRotation would use the original method, whereas this.getRotation would use the modified method?

honest spear
#

yea

#

this refers to its caller, if you call something.getRotation, then something is the this in the method

buoyant canopy
#

where can i find a list of the special strings that turn into icons for game controls?

honest spear
buoyant canopy
#

i don't know that to search for

#

what are they called?

honest spear
#

minecraft glyphs

#

or something like that

buoyant canopy
#

found it, it's Input keys

#

it seems they aren't working in ui...

harsh robin
#

guys tell me

#

can you write ts and js for mc bedrock even tho ts does get compiled to js?

distant tulip
distant tulip
harsh robin
distant tulip
harsh robin
#

@winged drift thinks other wise

buoyant canopy
harsh robin
#

r u talking abt json ui?

distant tulip
harsh robin
#

you get it coolbep

buoyant canopy
#

wdym?

winged drift
honest spear
#

btw JSON is valid JS code everyone

sharp elbow
#

JS is a superset of JSON

remote oyster
#

πŸ‘€

honest spear
honest spear
#

@remote oyster Whats then most weird JS syntax you know? it could be anything

remote oyster
#

To me? It's people who don't use curly brackets for closures and run it on one line. I find it weird. I've slowly started to do it myself after using JS for some years, but when I first started using JS that logic was foreign to me and it didn't make sense. It was like an incomplete sentence to me.

honest spear
#

Haha when i am lazy i do that, mainly for async scope thats not available or something

#

also for some reason i started using void expression a lot

#

with combination of return ofc

remote oyster
#
const add = (a, b) => a + b

Versus

const add = (a, b) => { return a + b }

Or

if (valid) console.log(1+5)

Versus

if (valid) {
  console.log(1+5)
}
honest spear
#

Ohhh, i am definitely the no brackets guy lol

remote oyster
#

I use to hate it lol

#

I've gotten used to it since, but I still find it very odd.

honest spear
#

but if so then this!!!

if (valid) 
  console.log(1+5)

remote oyster
#

No, absolutely not.

#

Lol

honest spear
honest spear
#

the lines are too long, maybe my taste got processed by formatters lol

remote oyster
#

The brackets make it more readable. Where it starts and where it finishes. Stuff like that blends in with blocks of code and becomes harder on the eyes in my opinion.

#

I feel like those that don't use brackets is just a fad.

honest spear
#

lol

#

i am too lazy

remote oyster
#

Haha

honest spear
#

but i just found out this syntax, after years of js experience

#
let anyVar = 0;
let otherVar = 0;

({anyVar, otherVar}) = object;
#

i always thought i have to use decleration to destruct haha

remote oyster
#

That was something I learned a little later myself.

#

Still learning new things too.

honest spear
#

but it make sence for perameters destructuring

thorn flicker
#

cant go without brackets, just looks wrong

honest spear
#

well i would say that JS is the most complete syntax i ever seen, i mean in every other language there are always some edge cases that doesn't works or weird hacks that doesn't seems natural in that language, but JS just works

remote oyster
thorn flicker
remote oyster
#

Throw it in and cook it up lol

honest spear
#

i guess

remote oyster
#

But I've grown to enjoy JS. Just took some time to get use to it.

honest spear
#

i found it really interesting of the concept how JS works in general, like the prototypes, its just cool idea on its own

honest spear
#

now i am starting to writing it again

#

idk

#

why

remote oyster
#

Lol

thorn flicker
remote oyster
dapper copper
thorn flicker
dapper copper
thorn flicker
remote oyster
honest spear
dapper copper
thorn flicker