#Script API General
1 messages ยท Page 129 of 1
mojang can't add support for everything at once + inventoryChange isn't just player moving items, it also about picking items up, modifying inventory through API and all that, so I don't think we will ever have beforeEvent for that
I know that, but it would be great to have more beforeEvents in the player's inventory, like canceling equipping equipment, or preventing the player from selecting a specific slot in the hotbar.
Hello everyone
if a player is on the death screen does checking player.isValid return false?
want to use a title command
If I'm not mistaken, a dead player is still valid
is there another function I can use for that
because I'm pretty sure title commands fail if youre on the death screen
how about health component actually
Not entirely sure ๐ค
Not very familiar with the component or the command tbh
I'll test it out later but it should work
does player.setDynamicProperty() work even if the player is not valid
and is there a way to make an entity aggressive to a specific entity only? so say make a zombie aggressive to a spawned chicken or something
Not valid
Even With instant respawn i have to wait 1 tick
let virusTicks = 0;
system.runTimeout(() => {
const virusInterval = system.runInterval(() => {
if (victim.isValid || virusTicks > 60) {
system.clearRun(virusInterval);
}
virusTicks++
},10)
}, 200)
this should run only when they respawn then right
Umm no?
You can use playerSpawn event
you just said it returns false if theyre on the death screen right?
this just checks to see if theyre valid every 10 ticks and if they are then that means they respawned
I recommend to use playerSpawn
this is for an ability function tho I'm trying to keep it all in there
You can listen to events in any moment
function myEvent() {
world.afterEvents.playerSpawn.unsbscribe(myEvent);
}
world.afterEvents.playerSpawn.subscribe(myEvent);````
๐ฎโ๐จ
Yo anyone wanna work on my realm with me? (I'm not dead weight I could do it myself and have actually it's done now and my friends and I play on it currently) But none of them program or make addon so I'm looking to make friends with someone with skills like mine so we can make new exciting content for the realm. We're working with some cool systems such as: a magic way, and dorios RPG core (which allows us to make and register our own trinkets. I'm currently working on some atm) I would prefer if you can build comfortably as well as we're trying to make a nice city on the realm and don't need anymore cave house people lol. Let me know if you're interested and we can talk about details!
^must have PC and mic
Should mention my skills too: I can script comfortably (I've ran into enough problems know I can work things out if need be) and can do any of the other things an addon needs like items, feature rules, loot tables, entity behavior. Im not a very good artist tho full disclaimer lol.
FINALLY
{"owned":[12],"selected":[12]}
is this a good way to do it?
numerical id based
sure but ngl i think using the number as the index and turning it into objects is better than an array loop for many reasons but that's your choice
also I'd recommend bit masks
You're gonna need a 5 bit integer tho since you have 20 ranks
(lightning fast, way better for every possible situation basically)
it's complicated tho so yeah
but I'm sure you can find enough tutorials on youtube or smth like that
well the only reason i have the ID thing is because
{"owned":[12],"selected":[12]}
``` this wont JUST store ranks, itll store other cosmetic items with unique ids and i just do checks script side to see if they already have a certain cosmetic id selected and just replace it
so like
1 - 99, chat ranks
100 - 199 capes / wings etc
200 - 299 hats / misc
or however else i do it
you can still use bitmasks :)
even better
you should
but question what does it actually like
but yeah you'll definitely use a massive amount of bits prolly
it just stores numbers
nah
it's js a number
literally that's it
gimme a sec
no not really
I'm not too familiar with like performance differences of access in an array and in an object
well tbf i am only updating when they change another one, and its just stored in the memory as cache
so i imagine its super fast stil
but you can use js const obj = { 0: ///, 1: ///, };
or
const obj = [
///
///
];```
and use `obj[idx]`
well probably it's fast currently
but if you ever need persistence
you might want to look into bitmasks
stringifying or just serializing in general isn't good since you store alot of data
i dont stringify
but it's unavoidable, but for certain things like flags, indexes, etc. you can use bitmasks
yeah i was thinking about flags
i was just saying
not really about the size
its getting sent to a postgreSQL database
do what
persist ranks and stuff in an external server/db
not that it's bad
it's just kinda inconvenient
nooo
i mean
so
im just storing which ones they own db side
and which one they have equipped
ill need it for later on indexing and counting up how many exist
yea i wasn't talking about the perf and size this time
i was talking about like the general issues like if the external server were to go down
or bad internet
yes you can guard such systems
but basically it's inconvenient for the players to have to wait for everything to get back
i dont think it will ever go down to be fair
but that's only at the worst case
yea probably
and their data is cached upon joining
I'm just saying
so im not just grabbing from the database each time
just my opinion, I'm not judging lol
you can do whatever you want to, it's your server dude
its just a locally hosted postgreSQL database through docker, which i read and write to from script api
ikik but i still dont understand the bit part
yeah that and like where would i actually use it?
well
let me explain
firstly do you know binary?
or should i explain it?
i do not ๐ญ
since bitmasking heavily relies on it
give me a second
I'll make a quick drawing
and then explain
okay my drawing app is broken
I'll just have to settle for this representation
[8][4][2][1]
[0][0][0][0]
alright so this is the binary representation of 0, pretty simple
the numbers on the top are like, imagine them as a value only there when it's one
[8][4][2][1]
[0][0][1][1]
this is 3
basically bits are each switch
like one bit, is one switch
0 is off
1 is on
we add the numbers on the top of the switchs that are on
the top part actually uses a formula
2^idx
so for the first bit, it's value is 2^0, which is 1
the second bit it's 2^1 which is 2
and so on
any questions so far?
i understand it a little bit
what part do you need help with
so an idea would be to store owned cosmetics as a bitmap
i generated a number
i basically convert the ids to bitmap type thingy
yea kinda..
1073741823 is ids 1 - 30
what
like that?
no
well
actually now that i think about it
telling you to use a bitmask for storing the selected rank ids is dumb
because you can select many IDs that are big in number
isntead of having an array like
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]```
i could just simplify it down to 1073741823
that could probably reach a big number that'd need bigint
yea basically
it's better if you had a set number of slots like say 3 slots for example, that'd be much more useful in that case
wdym?
or actually nvm you can use like a Uint8Array or something
like this
function getOwnedRanks(mask, maxRank) {
const owned= [];
for (let id = 1; id <= maxRank; id++) {
const bit = BigInt(id - 1);
if ((mask & (1n << bit)) !== 0n) {
owned.push(id);
}
}
return owned;
}
const mask = 1073741823n;
console.log(getOwnedRanks(mask, 99));``` returns the array of which ranks i have from the mask number
sorry I'm still learning binary myself too, your case requires a bit of thought since it's alot of big numbers like 30 and more
[
1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30
]
thats actually kinda cool
well, it gets even cooler once you truely fully understand it, cuz it feels like you just unlocked a cheat code
it seems very nice for storing data like that
i recommend asking a professor or like watching a tutorial
or even an LLM explaining
yea it is
i gtg
good luck on learning!
and on your server
cya
cya! thanks for explaining that to me its pretty cool
is this the optimal binary search ?
const count_items = (entity, item, guess) => {
const command = (count) => `testfor @s[hasitem ={location=slot.weapon.mainhand, item=${item}, quantity=${count}}]`
const check = (count) => entity.runCommand(command(count)).successCount
if (guess && check(guess)) return guess
let low = 1, high = 64
while (low != high) {
let mid = (low + high) >>> 1
if (check(`..${mid}`)) high = mid
else low = mid + 1
}
return low
}
won't this return true if the player have 0 item? ..count
low should be 0, otherwise it'll return 1 when the player has 0, and in the while loop, using low < high is a bit clearer
but otherwise yeah, that's optimal
I would also add > 0 after the successCount in check, cause rn you're returning a number
doesn't make a difference in the if but it's clearer
How frequently is count_items being called?
How long is PlayFabId of a player?
how would the entity have 0 items?
i don't get it?
this is for entities not for players, it will only run when the script determines that the entity has a specific item in its main hand, so i can't be 0
Pigs, cows etc. do not have any items
At last ๐ญ
๐ ๐ ๐
make it with an array
since the id is linear
This is probably an array already
so theres no reason to store the id inside the object
He has to remove id field and calculate it with by an index
i just think that it would scale better if he made a registering system
instead of everything being hardcoded
mojang is his sensei
wdym?
instead of hardcoding like this, itd be better if you made a way where you register these data instead
like
let id = registry.register("Red", "red", "static");
//now you use the id for the operations
ohhh yes
that would be cool
can do that
but question
what difference does it make?
wont it just be in an object either way?
if you want to modify it, you dont need to write a raw object
with modify i mean, changing some data or adding a new one
im supposing that array would change during runtime
if it doesnt, i dont see a reason for so
what's this for?
tyty
I hope they will improve DDUI soon, cuz I don't want to struggle with JsonUI...
Did they change onMineBlock that you need to set back to inventory to update durability?
since everything follows the same pattern, i personally think that passing arguments and then creating the object inside the function would help
if ur not using ts, its pretty easy to write a typo
and get some weird error
i personally used to struggle with this kind of thing
wdym
oh like
instead of typing out the "type" etc.. i just have arguments?
yeah
instead of this
.register("id", "item", 64, 5, "display", 2)
then you simply document the function to tell what each parameter does
so you dont write something like
.register({displayname: "displayname", ...}) somewhere
yeah
for sure, this supossing your not using ts
but i didnt see anything related to ts on the codes you showed
xd, mybad
the errors are very nice
so you can simply ignore this advice
i mean its still nice
and use an interface as argument
yeah
can i detect the potion type in 2.5.0 api? and what should i use to do so?
i came here to say that the fluid container block component has a setPotion method but doesn't have a getPotion method, what a coincidence.
for items it's item.getComponent('potion')?. potionEffectType.id
basically i need to detect the normal potion (water bottle) and nothing else, like if (potionType !== 'something') return
like normal potions wont be detected, but the normal water bottle will be detected
got it,
can I use this for changing players skins?
function changeSkin(player1, player2) {
const skin1 = player1.getComponent("minecraft:skin_id").value;
player2.getComponent("minecraft:skin_id").valua = skin1
}
like would this work
what's this level_tick? is it related to scripting ?
no, players do not use skin_id (unless you've modified the player json definition)
also skin_id is just a number, it's like variant and mark_variant and doesn't come with any actual functionality
It's not related to scripting, unless your script is doing something that would make the world slow down
Did you do anything to cause that spike?
not sure but i think yes, cause i am using my cache instead of getBlock, not sure if this is the culprit behind that spike
caching Block instances shouldn't do anything like that, it'll just increase script memory usage
the scripting has an average of 10-40 though, so i am not sure where that came from.
yep, that's what i think it should. not sure bout this level_tick
It's so stupid onHitBlock doesnt register if its mining.
is there no way to change their skins without using player.json? I am trying to see if I can make players morph into other players/entities
try using the profiller
maybe it helps you to find out what caused the spike
Well, for entities, it depends on if you're willing to do in terms of stop players from having access to their offhand slot, or any of the armor ones
You can't get a players skin, though, player.json or not
do you know how to get this on bds?
like not self hosting
What do you guys think?
https://discord.com/channels/1138536747932864532/1474572357271294063
lol. lmao even.
๐
Client scripting in 2026 isn't happening.
Worth a shot ๐
Are material instance definitions based on client?
If the definition of the texture is statically defined on the world, why couldn't the scripting method point to the texture definition defined by the world and not the client based texture?
Like gather it through the texture Atlas
Nope, haven't tried BDS as the target yet
i tried for a while and it just wonโt connect
more like never happening imo๐
Hello! I come asking if there as an alternate for "on_hit" for weapons and tools that used to use the custom component that could be run via scripts with the function array
i did what u said ts so peak
Hello! May I ask where I place the item custom component? Is it in components of the item or separate?
Thisi is so that a script to detect when an item is used or used to hit a thing gets read and runs a function!
Nevermind, it works!
now your just somebody that I used to know
I have faith in 2085.
I'd add enumerations to type and render, but it's very clean approach
I use the same approach across my projects also ๐
i thought about it yeah
You'll gain more type safety if you do this
EntityItemPickupBeforeEvent item property gives entity only? cus seems like typeId of it is just minecraft:item and not giving the actual typeId of an item
get the item component of the item entity
const { itemStack } = event.item.getComponent("minecraft:item");
oh okay thank you
is there a way to set bools on MolangVariableMaps for particles? tryna set a var called variable.underwater to true, but im only seein methods for colours, floats and vecs.
or is it some falsey coalescing where 0 is false and 1 is true?
booleans don't exist in molang
true is 1 and false is 0
Got screamed by the audio
Is there away to get the mob thats inside a spawner?
But no seriously, will Entity.target stay in beta forever???
Who knows.
LocationOutOfWorldBoundariesError: Trying to access location (-11.0, 173.0, -27.0) which is outside of the world boundaries.
said location is 10 blocks away from me. how is it outside the world boundaries?
what dimenion are u in?
camera.setFov
but does it change instantly or makes it smoothly?
it have ease options
One message removed from a suspended account.
One message removed from a suspended account.
export default function JennyUI(player) {
const inventory = player.getComponent("inventory").container;
const coins = getScore(player, "Coins");
const form = new ActionFormData();
form.title("Extras");
form.button("Blow");
form.button("crack");
form.button("dance");
form.show(player).then(async (response) => {
const i = response.selection;
if (i === undefined) return;
if (response.cancelationReason == "UserBusy") {
return system.runTimeout(() => {
JennyUI(player);
}, 10);
}
if (i === 0) {
blowJob(player);
}
if (i === 1) {
crackJenny(player);
}
if (i === 2) {
lapDance(player);
}
});
}```
can someone please tell me why its not waiting until the player is not busy to open the ui
bro
well, it's cause you're returning when there's no selection
and if the user is busy then there'll never be a selection
crazy work though
was going to say no one is helping you, but i guess someone need this add-on
One message removed from a suspended account.
hello there, how can i store some data in item?
i am trying to store it with .setDynamicProperty, but it seems like ynamic property disappears almost instantly
Are you setting the item back to the container?
no)
but now i will
thanks
isn't there a entity drop item event?
One message removed from a suspended account.
One message removed from a suspended account.
Stabilized in 26.10 if I recall.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I've been using it for loot protection. It's quite nice.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
There are command macros but global.
One message removed from a suspended account.
Per add-on though, I don't foresee it anytime soon, maybe late 2026 early 2027. Unlikely since it's keyboard only.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
isnt setdynamicproperty must do its work just well without any resavings? like if i call getdynamicproperty second time in tick, it gets it, but when i do it next time it gets empty again
If you:
item.setDP
item.getDP
in one function call it will work.
But if exit the function and lose access to the item object, doing item.getDP won't return anything since it hasn't been set back to the world.
how to save it to the world easily
Just set it back to the inventory.
thanks
works as intended
so uh
when did they break getting the faceLocation form a block raycast?
i can get it, but it's false for some sides
like hitting the top of the block, y should be 1, but is 0
Done (Resolved)
Awaiting Response
Hello all, is there any way to detect an item inside of a item frame?
block.getItemStack will return the item in the item frame, or an item frame if it is empty
It's equivalent to the internal method used when using pick block
Thanks man, much appreciated
is there a way to use async generators on runjob?
I suppose not, but I wonder if a job (using a synchronous generator) could use asynchronous generators when combined with promises or yield*
I need a way to use a lot less block permutations for my add-on, as I'm already getting 93,220 ๐
I thought the way I was making my add-on was pretty scalable, but apparently it wasn't.
And now I'm unsure of how to lower it, and I've tried for a few weeks now to come up with an alternative
So wondering if anyone here has a clue
what are you currently doing
#1464340249776750653
Problem is with so many texture changing, each texture change is a permutation/state
that doesn't answer my question
#1464340249776750653 message
a friend of mine which created the miniblocks has the same issue, i forgot how texture of blocks work, but try using a single permutation as a number and map this number to some X,Y axis coord
like, if you got 6, and you know its 5x5, then 6 = (1,1)
the performance impact is not worth it, it might be best to use entity
is there any entity that getComponent("equippable") equippable work on other than the player?
no
try to use player runtime id lol
not even armor stands?
Just get the inventory component
they do have an inventory component???
i am looking at the entity file of armor stands, they don't
No its disabled.
Nvm, then
Is there an easy way to make items on the ground unable to be picked up?
Use the before item pickup event.
didn't know that was a thing. thx
another thing, is there anyway to spawn an item entity. it isn't one of the options in dimension.spawnEntity()
spawnItem
ah, thanks
import {ItemStack} from '@minecraft/server'
dimension.spawnItem(new ItemStack('minecraft:egg',1),entity.location)
question, does scripting affects the ram? Like how much will the game consumes RAM, if you have alot of arrays and stuffs it's gonna slow down everything?
it really depends on how much you store
even around 50mb -200mb of data is totally safe in my opinion
for my server at least
8gb of ram
but if its just for storing player data youre chilling lowkey
i save their data in cached memory and even if i hit 10kb per player which is around 10,000 characters its perfectly fine for 50 players
Using memory is fine, but you want to make sure your memory is manageable and not being neglected in such a way where it steadily grows without notice. This is what we refer to as a memory leak.
Like in every single other program. More variables, more memory
in general not due to the minecraft scale
at least the amount you can control
Thankk you for the answers ๐
i'd recommend using other data types too like Map & Set
i dont think quickjs optimizes it too much
if the key is a string, probably its better to use a raw object
In traditional settings, using Map vs object will typically depend on how many keys you expect to have.
IIRC objects lend better to smaller sets of keys. Maps lend better to larger sets of keys
Does anyone have any idea how to remove the limited text in the new update
-# why would they do such thing ๐ฅ
-# context the command gets cut off cause of the text limit
The performance impact of that is so much worse when using it as a block entity
Unless I was testing it wrongly, which I admit could be the case
how many keys should it have to be considered as a 'large set'?
Really depends. This is where we start running performance metrics
thats why i hate js
all the knowledge you have about optimization can simply be thrown away depending on the runtime
At least it is a known runtime; it's no guarantee, but in theory we can look up existing performance metrics of QuickJS and make some guesstimates on how it'd perform in Minecraft
do you think instead of using a Map for strings, using an ART would be better in js for large amounts of data?
i mean
you got an Art that returns some ID idk, and use it as index inside an array
what are some good ways to detect memory leaks?
Usually Maps are better as they are hashed with an O(1) time, allocating them to a specific lookup "co-ordinates"
Only thing I could think of is TPS lacking behind but not sure which memory leaks you mean
You could use Mojang's VSC Debugger
i tried but no clue how to get it working on bds with a vps hosting it
Oh.
Fair
Would this not work the same?
Did you put the configurations as shown "allow-outbound-script-debugging", "allow-inbound-script-debugging" into the server.properties file and set to true?
yes
At what kind of world tick in Milliseconds is considered slow/bad?
for non-dynamic object, yes {} is ok, but when keys are removed, added, and lotta changes or dynamics, Map does better imo. I've had experience with leaking objects with just {}, so that's where I learned my lesson.
honestly i wanna stay away from anything below 18 tps
Idk how to check tps ๐
I just know how to check like server in MS
Through the Bedrock debugger
Count how many ticks are ran each second (if it even matters lol)
in js you cant exactly
the garbage collector does so for you
the unique thing i'd say is to dont save too much data that cannot be deallocated due to something pointing to it
im using like
htop and some RSS readers and just logging everything and comparing
i dont remember if the debugger has got something related to memory
but you could try using it
sorry, not debugger
profiller
i cant get it to link ๐ญ
oh yeah
no i cant get it to link
and i mean it seems to be fine
the mem keeps slowly rising but im not too sure if its from a memory leak
i started at like 2.33gb
but then the RSS for the bedrock server isnt really rising
it fluctuates a lot
Holy
you should profile the addon itself
thats not just the bds btw
htop sees everything
and minecraft by itself might have alot of things cached
that would make it harder for you to figure out if its your addon or not
When you said it just keeps slowing rising, kinda?
Like are you doing anything?
Could be surrounding chunks at the edge loading?
But I mean, 2GB only isn't really bad at all
i think what ill do is
Bedrock Debugger tells me I use 3GB on a superflat world
so i publicly exposed my bridge for discord to minecraft and my database
im just going to host the server on another vps
and talk to this other one
and then just closely monitor the one with the bds on it
but i honestly think its just caching minecraft stuff
chunks and what not
went from 925 to 913
Could be
i dont mind the steady growth as ill reset the server every few hours either way
Just leave it up for a few hours and see how high it goes
but as long as its not like consistantly just going up
seriously, its not an addon that will make the memory blow
Ye, I was about to say. Servers usually reset themselves every day anyways
So like unless it's Discord levels of Memory Leakage; it's not really a worry
Just keep it up for a few hours and see what it goes to
yes
its been running for 1.5 hours now
if i dont exceed 3gb within the next 2 hours ill say its fine
not ideal
but still fine
๐ง bros afraid of using about 3mb
huh
im at 2.43 rn
2.43 gb
so if i get to 3 thats what like
570mb
yeah its like oscillating
just a trend upwards
@fallow minnow how is it now?
sitting at 2.51 gb
interesting
oof now at 2.54
What does RSS mean?
But ye, it seems like there is a little bit of memory leakage within it
But it doesn't seem that bad
like how much memory that process is using
Installation for @minecraft/server
Latest API module install:
npm i @minecraft/[email protected]
Beta API module install:
npm i @minecraft/[email protected]
Preview API module install:
npm i @minecraft/[email protected]
Preview Beta API module install:
npm i @minecraft/[email protected]
Hello๐
Just a short question: I have an item that I want to use with right click on an entity. If I wanted to use the playerInteractWithEntity, it would only count, if I interacted with the villager trading menu for example right?
So if I just wanted to use my item, I would have to use itemUse and than get the entity within the viewing direction of the play?
Installation for @minecraft/server-ui
Latest API module install:
npm i @minecraft/[email protected]
Beta API module install:
npm i @minecraft/[email protected]
Preview API module install:
npm i @minecraft/[email protected]
Preview Beta API module install:
npm i @minecraft/[email protected]
Is there any way to grab entity lore from a script to test against a different value?
entities can't have lore
Aren't items on the ground entities tho?
We are trying to pretty much read a value off a spawned item
Can we access data with scripts?
entity.getComponent("minecraft:item").itemStack.getLore() should work
[object undefined]
Or however it goes
The code is from my friend but they're too shy to post apparently
world.afterEvents.entitySpawn.subscribe((ev) => {
world.sendMessage(toString(ev.entity.nameTag))
world.sendMessage(toString(ev.entity.typeId))
world.sendMessage(toString(ev.entity.getComponent("minecraft:item").itemStack.getLore()))
world.sendMessage("vulsmells") //very original ik
})
what is toString?
and this should work
converts value to a readable string?
.toString exists bro
Tried and it threw errors
what exactly did it throw?
I guess they didnt have an exception case
Something about invalid conversion or something I don't exact have the error in chat to look at rn
world.afterEvents.entitySpawn.subscribe((ev) => {
const entity = ev.entity;
world.sendMessage(entity.nameTag);
world.sendMessage(entity.typeId);
const itemComp = entity.getComponent("minecraft:item");
if (itemComp) {
const lore = itemComp.itemStack.getLore();
world.sendMessage(lore.join(", "));
}
});
You don't need to convert to a string when it already returns strings.
Ah
Also, the method used to convert to a string was incorrect.
Appreciate it but I'm already pondering alternative methods.
Can you distinguish between the item name and identifier in scripts easily?
Yes
Because I was thinking of making a custom item that summons whatever it's named before deleting itself
Just have to read the string and verify if it's what you are seeking.
test:mob_summoner
check name;
if not real return;
summon entity;
kill self;
Hey! Someone know why scripts don't work on realms and how can I make them work?
Scripts works on realms, there's some exceptions, But we have no way of knowing unless you provide more information.
I am using beta apis, I am using 32 java script files (doesnt matter, even a behaviour with just a script with console.warn wont work), format version 2
Idk what you need to knwo, but Ill provide it to you.
Send manifest.json
And console errors if possible
Nothing pops up, absolute void, nothing happens, not even the main file runs
{
"format_version": 2,
"metadata": {
"authors": [
"ItsBausan - Luminous Studios"
]
},
"header": {
"name": "Planetoid scripts",
"description": "1.0.1 - v91",
"min_engine_version": [
1,
20,
60
],
"uuid": "ca937367-f360-4263-951b-b7a3cddc387b",
"version": [
1,
0,
0
]
},
"modules": [
{
"type": "data",
"uuid": "f3ecc2e3-d66d-403d-8cc0-452d5f6fde73",
"version": [
1,
0,
0
]
},
{
"type": "script",
"language": "javascript",
"entry": "scripts/main.js",
"uuid": "61e237b7-56b6-4d76-b4e4-fb265710ca40",
"version": [
1,
0,
0
]
}
],
"dependencies": [
{
"module_name": "@minecraft/server",
"version": "beta"
},
{
"module_name": "@minecraft/server-ui",
"version": "beta"
}
]
}
Hmm gimme a sec
lmao
next time check if the addon is added using /packstack server verbose exclude-vanilla
how do i create a itemStack of potion tipped arrows?
yao, my xCore addon (that has all of my addons functionality) has 49 dynamic properties and its total bytes count is 1455, is it fine? like when should i start caring about the dynamic properties impact on performance?
if you are not getting a warning you are fine
not possible afaik? maybe with commands
thats what i figured, its just a big pain to do it via commands
this is stupid
@lyric kestrel alright so bad news @dusky flicker
dont mind the 0.01mb / hr, its actually aroumd 50-50mb/hr
although after around 8 hours the mem didnt reach 3gb its itll not good
def a leak
theres leak
but damn
it not that much
but it could be good enough for you to study
have you got any idea of where it could be?
i dont know exactly how to measure memory usage
could it be like
tsc watch?
actually no
im going to try something
if its my scripts
im checking it
ill know if i reload and it drops
ur running on windows?
linux
thank god
okay rip it def is my code prob
after reload it dropped to freaking
1231291 node 644432 8.1
jeesususuususuu
2.16gb
okay im going to check through every single file
{"xuid":"2535438968243754","username":"uzis mine","coins":116912,"gems":103,"level":1,"last_online":1771893231264,"experience":0,"blocks_broken":545,"blocks_placed":524,"mobs_killed":1,"coin_multiplier":1.3,"owned_cosmetics":[12,20,21,22,23,24],"selected_cosmetics":{"hat":0,"cape":0,"rank":21},"rank_text":"Elite","entitlements":{"elite":true},"daily_quests":{"t":2,"v":2,"seed":436268936,"slots":[{"c":0,"p":0},{"c":0,"p":0},{"c":0,"p":0},{"c":0,"p":0},{"c":0,"p":0},{"c":0,"p":2},{"c":0,"p":0},{"c":0,"p":0},{"c":1,"p":43}],"dayKey":"2026-02-23"}}``` this is the most amount of data i store
which never gets set to the cache again
as json?
yes just for testing
well so
its stored as sql columns
and i just convert to json structure and cache it
okay MIGHT have found it
what do you suppose its?
this
const from = { x: -370, y: 82, z: -38 };
const to = { x: -364, y: 75, z: -37 };
const volMin = {
x: Math.min(from.x, to.x),
y: Math.min(from.y, to.y),
z: Math.min(from.z, to.z),
};
const volMax = {
x: Math.max(from.x, to.x),
y: Math.max(from.y, to.y),
z: Math.max(from.z, to.z),
};
function isInsideBlock(pos: Vector3) {
return new BlockVolume(volMin, volMax).isInside(pos);
}
const island = new IslandManager();
const handledPlayers = new Set<string>();
const lastInside = new Map<string, boolean>();
system.runInterval(() => {
for (const player of world.getPlayers()) {
const xuid = player.xuid;
const insideNow = isInsideBlock(player.location);
const insideBefore = lastInside.get(xuid) ?? false;
lastInside.set(xuid, insideNow);
if (handledPlayers.has(xuid)) continue;
if (!insideBefore && insideNow) {
handledPlayers.add(xuid);
(async () => {
try {
const hasIsland = await island.has(xuid);
if (!hasIsland) {
await islandSelection(player);
return;
}
island.teleport(player);
} finally {
handledPlayers.delete(xuid);
}
})();
}
}
}, 20);```
oka nvm not that
lastInside would yeah start to grow because it doesnt clean up
you could probably remove the lastInside map entirely, since you already return if handledPlayers has the xuid, which is set once they're inside
currently im converting like everything over to my actual cache that i forgot to never use!
so its just a whole bunch of random maps and sets and etc
Memory leaks are fun ๐
genuinely have no idea what its from so
but im switching over ALL of my registries and everthing to my cache class
then we will see
That code you shared has a memory leak with lastInside. That map gradually accumulates data and when players leave or disconnect that data isn't being cleaned up.
yeah i changed it to just automatically delete the players lastInside after it completes
I'm sure you got a lot of code to look at but anything storing data in memory needs to be verified if that memory is being handled in cases where the data is no longer relevant. Such in cases where a player leaves or disconnects.
Memory should be temporary storage, not permanent.
well
the only memory i store for the player is their island data and player data
which are both deleted after they leave
but i also cache things like
cosmetic entries from my database, registered enchants, registered generators, quest templates, command registry, reward templates
okay i fixed everything to use the cache thing i have and hopefully fixed the memory leaks
looking good so far
yo
Is there a list of every API Error? (like ReferenceError: Native function [Class::method] does not have required privileges)
Is there a way to get the player's skin by scripting?
check in the docs if the method cannot be run in read-only mode
for example before events
? I am searching for a list showing every API error, this was just an example
Are you looking for the specific message or instances of throwing errors?
Basically for a list providing every possible API error (such as the one I provided)
But I doubt I might find anything
Message content and error type
Error type you can look at the docs or npm types. Message, I dont know if theres a public one, you'll have to test in game.
Thanks, Appreciate it 
Oh if you dont mind me asking, there is an error when you try executing something in the early-execution mode. when a function doesnt explicitly says "This function can be called in early-execution mode" it means they cannot be run in this mode. right?
Correct.
By any chance, do you know the thrown Error instance? I cannot find anything nor test
Not off the top of my head no.
Alright, still thanks 
@dusky flicker looking good?
its stable hovering for the past 10-20 minutes
thank the lord
can script detect block's collision? example if a block has a collision size not more than [8, ~, 8] then it will return true
we can't cancel the message for when a player joins the world right?
no sadly
what i did is uh
i used json ui and just hid the "joined the game"
or world
BUT ive noticed something weird.
since ive "disabled" the join message, scripts still sometimes duplicate it..?
its very strange
ah.. I'll see what happens when it's disabled in my game then
I finished implementing a friends list system and now it's kind of weird since there are double messages
which just defeats the purpose of a friends list
beyond this
Minecraft Bedrock API in a nutshell
yeah its really random like the normal vanilla join text
i can leave and join a whole bunch and itll just randomly duplicate when sending the message with player events after spawn
Did Microsoft already switched from UWP to SDK? Last time I checked was a year ago
Thanks Microsoft for nothing but bugs
replace eachother or just disregard what ive changed in my rps
I hope the CEO of Microsoft gets replaced
๐ญ
See the positive~
also i pinpointed my MEMORY LEAK / ALLOCATION CHURN thing ๐ ๐ ๐
I wrote my own Server module API because I cant play MCBE Win
it was my wind thing which checks the surrounding chunks around the player and randomizes wind speed with weird noise
and my sidebar??
i guess
i was being stupid and umm
i was spam showing the sidebar every tick WHILE getting the players ping every single tick
WHAT
which returns a promise
i didnt know it was that bad ๐ญ
im using endstone so
i dont normally have access to ping
but i was also calculating the tps and displaying it every tick
my cpu is fine tbh
im honestly thinking about just hosting everything on this vps
its only $4.90
4vCores, 8gb ram, 75gb ssd
yeah, let your pc rest
anyways gtg, I spent the last 10 hours with no sleep on something stupid
what was it? seems to be better than before
my wind system and sidebar i guess
๐ญ
i tested the same way by just sitting in the world for an hour and i disabled my wind interval and sidebar interval
only ~50mb /hr
which seems normal
no way how was a wind system having leak
xd
is there a way to put dynamic values into command selectors?
it was allocation churn
i was at like
like 150-200mb /hr
now its at 55
it does go up but not enough for me to optimize more
and its most likely just minecraft doing whatever it does
weird how minecraft can't find the memory leak by itself
i think they should add a flag or something to stop the addon or something
when the memory increases
profiller?
man as far as i used it
i did port 19144 vps ip
i opened up the port just to test
wouldnt work
nothing
first i start it on the vscode with listen if im not mistaken
yes
and on minecraft connect it to the same port
yeah but it just doesnt work ๐ญ
but i use the terminal
oh i used that weird json thing
want to use Notepad++ instead
these days im using zed and helix
but notepad++ isnt bad at all
by the way
cant you open some issue or something like that
to ask mojang to detect when an addon uses too much memory?
iirc there is an "setting" for it
on custom commands, not possible atm
is there a way to lessen the amount of entities that spawn from spawners?
like lessen the time
or something
how do i get custom component information from an item?
i mean, not necessarily it being on a event executed from a custom component
getComponent(your custom component)
It should return a customComponentInstance and you can get tge parameters.
thanks my friend
Gmorning
can you access dynamic properties in the world file
like see all the dynamic properties that were set on your world
I think yes by using NBT tools or something, check Google for it
Does anyone know why the script only works for me, but my friend gets this error every time he's hit by the entity I assigned?
[Scripting][error]-Error: Failed to resolve identity for 'GroberPC3843'. at <anonymous> (custom/menu_ent.js:139)
This is the code
const statueObj = world.scoreboard.getObjective("statue")
?? world.scoreboard.addObjective("statue", "statue");
world.afterEvents.entityHurt.subscribe(ev => {
if (ev.hurtEntity instanceof Player && ev.damageSource?.damagingEntity?.typeId === "papu:medusa") {
ev.hurtEntity.dimension.playSound("health_stone", ev.hurtEntity.location);
let score = statueObj.getScore(ev.hurtEntity) ?? 0;
score += 1;
if (score > 20) score = 20;
statueObj.setScore(ev.hurtEntity, score); //This is line 139
....
I remember that you grt this error if he doesnt has a score
Make sure his score is at least set to 0 before getting it
Maybe write a function to get a certain score and use try catch
I can't remember ever getting an error from that
Hmm weird
Use this
let score = 0
try {
score = statueObj.getScore(ev.hurtEntity) ?? 0;
} catch {}
Should work
The error was at linie 139 tho. Also hasParticipant would be a better way of checking that
True, I am on phone right now, may you write him a getScore fn ?
You were right, I added at least 0 points and it started working
Weird. Never had that issue.
Well maybe because your users always had a score
I tested it without score and it worked
When you create a scoreboard no one has a score until you add/set it to 0 or else
Huh weird
But good to know, because I am writing my own Server module API (cant play Mcbe and got bored)
That errors comes from the entity having no ScoreboardIdentity like player.scoreboardIdentity is null where the entity currently has no score from any objective
Doing hsParticipant will try to look for the identity, which will make that error again.
But when entity is already a participant of other objective, hasParticipant will never throw
Has anyone experienced an issue where reducing the damage below 1.0 in world.beforeEvents.entityHurt prevents the hurt entity from receiving invulnerability frames?
here's my code just in case someone want to test it
import { world } from "@minecraft/server"
world.beforeEvents.entityHurt.subscribe((event) => {
event.damage *= 0.5
world.sendMessage(`Damage: ${event.damage} || ${Math.random().toFixed(1)}`)
});
Is it possible to make the costume block spawn XP by breaking it cuz I tried in the behavior pack and script and loot table ?
you should be able to spawn the xp entity in a playerBlockBreak event
I don't know how
By using the Dimension class your can use the summonEntity or spawnEntity method
Im not sure currently, better check the docs or try finding it when you have the npm installed
"myaddon:modular_item": {
"range": 80,
"damage": 225,
"knockback_strength": 12,
"on_hold": {
"movement_module": {
"velocity": 3
},
"shooting_module": {
"projectile_entity": "minecraft:arrow",
"power": 3,
"keep_shooting": true,
"shot_interval": 2
}
},
"on_desselect": {
"shooting_module": {
"stop_shooting": true
}
},
"on_sneak": {
"dash_module": {
"velocity": 2,
"rotation": 1.57,
"y_power": 1
}
}
}```
Is this organized enough?
just setup a 'module' inside the component, and thats it, you ready to go
For performance reasons, custom components are limited to a depth of 2.
๐ง no way they dont cache the objects
i might have to think in a better solution for this then
damn i never thought id need to use dod knowledge in json
Startup gets called before worldLoad
And after the "tick" ticks?
Any way to fix this so it looks for an exact match and not whether it just includes the value
We are using Includes because getLore by itself wasn't working
with includes it doesnt check if it only has those, but if it has those alongside anything else. Right now the problem is i dont know how the getLore returns its value, and the variants i tried didnt work
Check for lenght too or compare .join().
ngl the values being returned are js annoying, i'm tryna get a different thing working but it aint, even though it allows me to use the value as a string later in my code with no issue
world.sendMessage(ev.entity.getComponent("minecraft:item").itemStack.nameTag)
the length could work, but only if i figure out what the length actually is.
besides, knowing the returning format would just be overall useful for later things were i to use lore
getLore(): string[];
exact match of what? Right now you're looking for an exact match of "Usage: Rename with [entityName] [count] [nameTag]"
I thought "includes" just means it has to contain the phrase somewhere in the output not that it has to be an exact match
Sorry, it does, but why are you looking for a string like that
If you want an exact match, just do loreString === "Expected String"
We have this item that pretty much acts as a better spawn egg but we couldnt test typeId for some reason, so we resorted to testing for the lore that tells you how the item works
Since no other would have the same lore
Is it possible to make a particle size bigger or smaller by spawning via Scripts?
Performance matters btw.
yes, with MolangVariableMap, you can create a variable in scripts to use in the particle json file
Documentation for @minecraft/server
and then I use like v.name to access?
yes
like if I .setFloat("r",5), then v.r in the particle json is 5?
mhm
Okay ty I figured out ๐
mhm means yes
good to know
i somehow managed to do this:
and i made it even better,
@distant tulip this is what i meant by 'detecting when the player jumps' 
there is an evemt for that if it is not what you are using
what kind of event is that?
PlayerButtonInputAfterEvent
nope, that doesnt work properly, it cannot detect when the player entity jumps as u can see in the video
it will only detect when the button is pressed or hold,
you are overcomplicating things
how is my code overcomplicating while this one exist? https://discord.com/channels/523663022053392405/1264459228521959425
the event is new
just add a player.isJumping condition
well, try making one that isnt overcomplicating and works better than the one i made,
.
import {world, system} from '@minecraft/server';
export const ePlayers = new Set();
world.afterEvents.playerJoin.subscribe(({playerId}) => {ePlayers.add(playerId)});
world.afterEvents.playerLeave.subscribe(({playerId}) => {ePlayers.delete(playerId)});
system.runInterval(() => {
for (const ID of ePlayers) {const player = world.getEntity(ID);
if (!player?.isValid) return;
if (player?.isJumping) console.warn('jump')
};
});;```
@distant tulip.
-# unless if im doing it wrong and i have no clue how it should work,
bro,,,
runInterval is not the way
it's isJumping, not hasJumped
actually, the method with input button won't work with auto jump
how else am i suppose to make it work then?
if i already did make it work https://discord.com/channels/523663022053392405/1476541799098093619
you use the event to start the interval and clear it when unPressed
just.. show me an example of that work, or just send me the script so i can test it out
/** @type {Record<String, import('@minecraft/server').Player>} */
const PlayersMap = {};
/** @param {WeakSet<import('@minecraft/server').Player>} */
const PlayerHasJumped = new WeakSet();
world.afterEvents.playerSpawn.subscribe(data => {
if (data.initialSpawn) PlayersMap[data.player.id] = data.player;
});
world.afterEvents.playerLeave.subscribe(data => delete PlayersMap[data.playerId]);
system.runInterval(() => {
for (const player of Object.values(PlayersMap)) {
if (!player.isValid) continue;
const isJumping = player.isJumping; const hasJumped = PlayerHasJumped.has(player);
if (!isJumping && hasJumped) PlayerHasJumped.delete(player);
else if (isJumping && !hasJumped) {
PlayerHasJumped.add(player);
console.warn('jump');
}
}
});
``` not tested
nah, still won't work. Auto jump doesn't trigger button input event so u won't be able to detect it and interval is useless here
doesnt work properly,
hmmm
works perfectly fine when u press the jump button,
ah, i thought you are referring to when the player continue on pressing the jump without releasing
lemme test my one with auto jump
needs to add isOnGround condition too...
/** @type {Record<String, import('@minecraft/server').Player>} */
const PlayersMap = {};
/** @param {WeakSet<import('@minecraft/server').Player>} */
const PlayerHasJumped = new WeakSet();
world.afterEvents.playerSpawn.subscribe(data => {
if (data.initialSpawn) PlayersMap[data.player.id] = data.player;
});
world.afterEvents.playerLeave.subscribe(data => delete PlayersMap[data.playerId]);
system.runInterval(() => {
for (const player of Object.values(PlayersMap)) {
if (!player.isValid) continue;
const isJumping = player.isJumping; const hasJumped = PlayerHasJumped.has(player);
if (hasJumped && (!isJumping || player.isOnGround)) PlayerHasJumped.delete(player);
else if (isJumping && !hasJumped) {
PlayerHasJumped.add(player);
console.warn('jump');
}
}
});
``` try this
my system is kinda bugged when falling from a block, but works perfectly fine with auto jump
hmm
that's how isJumping works.. u can add a test for vertical velocity
its bugged under slab
?
spam the event while standing below a slab and holding the jump button
ohh
Well I tried...
and my system is now even better lol
import {world, system} from '@minecraft/server';
const jumpCache = new Map();
export const ePlayers = new Set();
world.afterEvents.playerJoin.subscribe(({playerId}) => {ePlayers.add(playerId)});
world.afterEvents.playerLeave.subscribe(({playerId}) => {ePlayers.delete(playerId); jumpCache.delete(playerId)});
system.runInterval(() => {
for (const ID of ePlayers) {const player = world.getEntity(ID);
if (!player?.isValid) return;
const yVelocity = player?.getVelocity().y;
const hasJumped = jumpCache.get(player?.id) ?? 0;
if (player?.isOnGround) jumpCache.set(player?.id, 0);
if (!player?.isOnGround && yVelocity > 0 && hasJumped === 0) {jumpCache.set(player?.id, 1); console.warn('jump')};
};
});;```final results
now falling from blocks doesnt count as jumps,
and that doesnt work with auto jump,
yeah you did overcomplicate it
you could simply check when the player presses to jump
and check if hes on the ground
-# auto jump...
-# why writing like this?...
bec auto jump cannon be detected via the button inputs
i just dont think it checking the y axis of the player velocity is a good way to do so
ill do some improvements, like it might return jumping while climbing scaffoldings or ladders,
๐ญ
i haven't tested those things yet
i mean, i personally, prefer that working properly but unable to check some specific occurs, such as auto jump, rather than being buggy and checking when i dont want to
for me, i do need to detect everything for my stamina system,
i'd rather focus on implementing other systems on top of the stamina one
and then improve the way the stamina system works
if setlore() requires an array, how does it return the value in getlore()?
It returns an array of string
how can i read it as an array to see if the whole array matches another?
so far i tried to and either i did it wrong, or its not reading as an array
You have to check every element of the first array and compare it to the value of the second array
function arraysEqual(a, b) {
if (a === b) return true;
if (a.length !== b.length) return false;
return a.every((value, index) => value === b[index]);
}
If standard Null / undefined checks aren't working. What could be a possible cause?
Do you mean you're trying to check if an item has no lore?
How are you checking? getLore returns an array, so if an item has no lore it will give you []
But you can't check if the lore === [] because that's always going to return false. Equality checks on arrays in JavaScript don't check that the value of the arrays are the same, they just check if the two sides of the equals sign reference the same array.
That's why [] === [] is always false.
We tried to move to a name based system and null checking was a pain
Im ngl the code is so ugly rn and I would fix it myself if I had the skill but it's a joint project and I'm more just the gameplay designer guy
Can you explain more about what you're trying to do? There's almost definitely a better way to do it than using lore
Since we can't run mob summons in loot tables we are trying to make an item that does that
If it exists in the world it'll check its name and use this formatting to summon entities
<typeId / name> <amount> <nameTag>
rude
i made that code
world.afterEvents.entitySpawn.subscribe((ev) => {
if (ev.entity.typeId == "minecraft:item") {
const name = ev.entity.getComponent("minecraft:item").itemStack.nameTag ?? "null"
const lore = ev.entity.getComponent("minecraft:item").itemStack.getLore()
const type = ev.entity.getComponent("minecraft:item").itemStack.typeId
const spawner = name.split(" ")
if (type == "cnr:omnispawner" && name != "null") {
if (name.includes(" ") && spawner.length > 1 && isNaN(spawner[1]) != true) {
const count = Math.min(Number(spawner[1]),64)
if (spawner.length == 3) {
for (let i = 1; i <= count; i++) {
try {ev.entity.runCommand("Summon " + spawner[0] + " " + spawner[2])}
catch {ev.entity.kill()}
}
ev.entity.kill()
} else{
for (let i = 1; i <= count; i++) {
try {ev.entity.runCommand("Summon " + spawner[0])}
catch {ev.entity.kill()}
}
try {ev.entity.kill()} catch{}
}
} else {
try {ev.entity.runCommand("Summon " + spawner[0])}
catch {}
ev.entity.kill()
}
}
else {
if (type == "cnr:omnispawner") {
ev.entity.kill()
}
}
}
})```
I just meant it can be compacted
why do you need lore then?
Cause we had trouble testing names before, it's fixed
now it's just code compaction, we figured it out while looking for the solution (crazy I know)
well, its very easy to do then..
you can use the minecraft debugger
and start testing your files one by one
unless you have any clue of what is causing the memory leak
there is memory usage there iirc
it could be variables, maps, jobs, or promises accumulating
yea but i think it doesnt tell you what exactly is using that memory
const EntitySpawnerItemId = "item_type_id";
world.afterEvents.entitySpawn.subscribe(data => {
const entity = data.entity;
if (entity.typeId != 'minecraft:item' || !entity.isValid) return;
const item = entity.getComponent('item')?.itemStack;
if (item.typeId != EntitySpawnerItemId) return;
const dimension = entity.dimension;
const location = entity.location;
entity.remove();
const spawnerData = item.nameTag.split(' ');
const spawnAmount = Number(spawnerData[1]) * item.amount;
const spawnTypeId = spawnerData[0];
const spawnNameTag = spawnerData[2];
for (let i = 0; i < spawnAmount; i++) {
const spawnedEntity = dimension.spawnEntity(spawnTypeId, location);
if (spawnNameTag) spawnedEntity.nameTag = spawnNameTag;
}
});
``` try this
and change EntitySpawnerItemId to your item type id
it works, but not without preventing some issues i was hoping to cover
specifically instances such as this, where some arguments are correct, and others arent
my own code ensured that as long as the first argument was correct, the others either would be ignored, or would adapt (so if it was the below image, it would spawn a skeleton with name "aa" rather than just nothing at all)
i'm pretty impressed with the code you gave, so while i could modify it to add these exceptions, im sure that my changes would probably make it look just as bad as before
out of curiosity, why is there a semicolon on every line?
Semicolons separate statements
Line breaks can also implicitly separate statements in JavaScript so having them at the end of lines is optional but I prefer having them personally since it makes copy/pasting easier
Ye, in other languages it'd be needed, but JS has something called "Automatic Semi-colon Insertion"
So when the compiler is compiling, it automatically inserts ; after statements
Automatic semi-colons are a nice convenience but explicit is always better IMO. There are a couple of cases where newlines don't delimit meaningful tokens like you would expect, and placing a semi-colon manually would change the behavior
makes sense, i knew semi colons separated ones on the same lines, but line breaks combined with them seemed odd at first
kinda curious what that would be now...?
In a case like this, ASI cannot determine if the object literal (in parantheses) on line 3 should be its own statement, or if it is a function call on the variable a:
var a = "hi"
a
({foo: bar})
that kinda makese sense, but what is a doing there anyway?
It'd happen mostly where you're preparing code and might erase something, making a typo. I've needed to wrap object literals in parentheses for arrow functions and encountered something like that before
This may be a bit more demonstrable:
var a = {"hi"() {return 1}};
const b = a["hi"]
(a.hi() + 3).toFixed(2)
Should b be assigned to the method "hi" on a? Or should it be the result of calling "hi" on a?
Of course, erasing the parentheses on line 3 could solve this too.
Edited it to include an example where that is less trivial of a solution
why exactly would it execute a function call implicitly?
If I replace the line breaks with spaces, it becomes more apparent:
var a = {"hi"() {return 1}}; const b = a["hi"] (a.hi() + 3).toFixed(2)
the JavaScript engine assumes a["hi"] (...) is an invocation, since it looks like an invocation
(It's probably a bit more technical than that if you want to get into operation sidedness, but that's the intuitive answer to me)
In my opinion, I don't really care about these features. Good JavaScript developer will switch to TypeScript and keep his code organized anyways, these code snippets are a good example why some people shoudn't even touch this language
It's not the best for every single thing on this planet, but it gets job done and even the biggest companies like X (Twitter), Adidas, Uber, LinkedIn use it on backend
i think the main reason for so its because JS(and consequently Ts) is easy to be used
and to learn as well
so you wont pay as much as you'd for C devs for example
i mean, here on brazil i've seen a job vacancy for rust, about 20k BRL, in dolars right now it might be around 4K, but for us that amount is insane, since the minimum wage on brazil is around 1500 brl
in general for js here i see at most, 7k brl
Web development in general is mostly less worth than Rust and some other niche languages like Elixir
Whats the default particle minecraft uses for death, im replacing it
current downsides:
breeze-balls when used to launch the player, it will detect the launch as a jump,
getting hit by a mace that has density (that will launch u in the air) will also be detected as a jump, basically anything that makes u leave the ground (besides riding a mob or ender pearls or /tp) will be counted as a jump,
is there other ways that makes u no longer onGround?
elytra doesnt count bec u have to jump to activate it,
i mean, is just autojump that isnt tracked by the player input?
if so
you can do a system that you check the velocity of the player
and check the position near him
getting a vertical knockback will count, like from explosions will count as a jump

