#Script API General
1 messages ยท Page 142 of 1
My brain hates trying work with queues especially when they have to store a lot of data like time stamps
It just becomes variable hell really quickly
Tbh I have a lot more respect for people who make veinminers
It's really hard
Not when you're tryna bake in a wave pattern + config
try using claude
I'm not using AI
That's vibecoding
I have to figure this out myself
Once I figure out loops
Cause block A needs to check 6 different locations for block B
And then all instances of B to C
And so on
I have no clue what I'm going ๐
ai is beneficial for learning and teaching
I'm trying to figure out maps
Since I could run individual instances that way
I think???
Why do I have to be doing this on 2 hours of sleep
I meant more how to apply them here
Yeah I give up
I don't know why I thought I could do this
I'm honestly garbage at scripting anyways
dw we've all been through that at some point
How hard can I really be to handle several dozen iterative maps under specific tick constraints while maintaining the integrity of the vein being mined and avoiding duplicate loot drops while taking into account enchantments on each block affected
It's honestly preschool level stuff
I think a hello world program is more difficult
I mean, what are you trying to do in the first place?
For the looks of it, you just want to do a vein miner?
Is there a way to do something along the lines of save a Tickingarea into something like an array for later use
Documentation for @minecraft/server
I'll try that out, thank you :D
Pretty much, none of the ones online have the features I want
Just for curiosity, what features does it need to have?
Yeah, it uses a tag detection system:
Entity has thag tag at the time of damage, and activates the parry. Restores the health taken, gives it to the attacker. Of course, it also has a damage cap, and it works without the tag.
Let's say the damage cap is 30, the entity gets shot with a super OP damage that deals 200 HP out of the entity's 300, the HP would be taken, calculated to reduce the excess damage from the entity, and subtract, while also healing the entity of the excess damage (except for the 30 damage that did not exceed the cap) so 200 goes in, 30 goes out, and the entity looks like it had a seizure
Im too lazy to think about how to make a veinminer, but ig that's about detecting neighbor blocks in given amount of times
Sorry for late reply I thought you'd ping, but I plan to add a config / support enchantments
Enchantment support is quite easy. I wonder why Marketplace doesnt add them.
/vutil:veinminer_add_block <blockID>
/vutil:veinminer_remove_block <blockID>
Probably not via a command because apparently I can't set up custom commands for the life of me but pretty much this
Its ok, don't worry about it.
Did you tought about just using a loop? It doesn't need to be more complicated than that
I'm aware of loops. No veinminer can work without em, my issue was I have 0 clue how queue systems work codewise. I can visualize a flowchart but error in translation
Though it's 2am so i stopped working on it for the night about 2 hours ago
Jmm why would you need to use a queue?
Apparently the best method is to just queue all the blocks and resolve the chain backwards
Breadth-first search method
What do you mean by all the blocks? wouldn't it be more efficient to just store the target's type blocks and then work with that?
Well yeah that is what you would do
But you still need to queue every instance of that block as a coordinate
So the script knows what to break
I don't think this method support the flow animation I want to add tho
Yes but that's the same as just iterating over the array of selected blocks. I guess you can use a queue to do that, but in my opinion thats not necessary.
I'll just spend another 6 hours tomorrow trying to figure it out
I don't got nothing better to do
If you store the blocks you selected in order, then it should look fine with animations
I'd have to like save an iteration value
And play each iteration 1 tick after each other
I was never a fan of the instant ones
I don't have nothing to do either, so why not help?
This feature was going to be a part of a larger pack
Well it would be appreciated but I'm done working on it for tonight
It may be quite late for me
Ok, for me it's still early... So I'll post what I came up with and then I'll tag you so you can check it when you want
Is there a way to generate lightning without causing damage or fire?
This is my progess for the time being. It works... Kinda, some blocks seem to repeat, in the result list, for some reason and I cannot figure out why... I'll do it later.
import { Block, world, system } from "@minecraft/server";
function veinMiner(startBlock:Block){
let location= (block:Block) => `${block.x};${block.y};${block.z}` // vector3 -> unique string
let result: Block[] = [] // all blocks scanned
let selectedBlocks:Block[] = [startBlock] //soo this end up stransforming into a queue
let resultLocations:string[]= [location(startBlock)] // all blocks scanned's location in string form
let blockType = startBlock.typeId // thr block type we're looking for
for (let i=0; i<10; i++){
let selected= selectedBlocks.shift()
if (!selected) break
let adjacentBlocks:(Block | undefined)[] = [selected.above(), selected.below(), selected.south(), selected.north(), selected.east(), selected.west()]
for (const block of adjacentBlocks){
if (!block) continue
if (location(block) == location(selected)) console.warn("how?")
if (location(block) in resultLocations) continue // already scanned
if (block.typeId!=blockType) continue
selectedBlocks.push(block)
resultLocations.push(location(block))
result.push(block)
}
}
return result
}
world.beforeEvents.playerBreakBlock.subscribe(v=>{
let heldItem = v.player.getComponent("inventory")?.container!.getItem(v.player.selectedSlotIndex)
if (!heldItem) return
if (heldItem.typeId !="minecraft:stick") return
v.cancel = true
system.run(()=>{
let blocks = veinMiner(v.block)
console.warn(blocks.length)
for (const block of blocks){
block.setType("iron_block")
}
})
})
console.warn("loaded 123")
Does someone knows if I can spawn a custom entity with a nametag, and it to show when looking at the entity just like any nametag without requiring a game reload
I don't know why it requires me to reload the game in order for the name tag to show normally
Okay, handling it purely with scripting and not relying on JSON fixes it
Scripts are scary, man
New update. This time I take a different approach. I used node trees. It works as expected. It doesn't seem to have bugs. It's only problem seems to be efficiency.
.
Is there any way to apply the freezing screen from powdered snow via scripts?
Do dynamic properties have to be entity linked?
Entity, world, unstackable item
Or players
so I can do world.setDynamicProperty()?
yes
Well that solves 1 issue
Now I just need to figure out the other 30
I might need a local nested function
I'm still trying to understand queue systems
This isn't right
I feel useless
Now I need to find out how to build a new set from this data...
My head hurts...
Idek if the data is right
I think this is right
But how would I make it recursive
Or I guess progressive
Do I need ANOTHER loop + index to track it????
Don't tell me this is the entire system or I will find a way to block this message.. getting given the correct answer is not good for learning
It's like trying to pass an exam by letting someone whisper the answers to you
It doesn't help me get better
Even if it takes me a week and a few hammers to the head I will figure this out without being given the answer
I want to learn not to plaguerise
okay
I'm asking for advice on the methods not a full implementation with 0 effort on my part
Whether I'm going the right steps
I know the format I need to build but it's just so difficult
const oreMap = [
[[Loc 1]],
[[Loc 2a], [loc 2b] ...],
[[loc 3a], [loc3b] ...]
]
Then I evaluate each member of oreMap with 1 tick of spacing between them
Is this at least the right approach
@woven loom
Building this structure so I can break the correct ores
what are you tring to do btw
Just a simple veinminer with a few extra features I can't seem to find anywhere else
But it's the first time I've ever tried to make an "expanding" system
FUNCTION VeinMineSearch(startBlock, maxBlocks)
targetType = startBlock.type
create empty queue
create empty visited set
create empty result list
add startBlock to queue
add startBlock position to visited
WHILE queue is not empty
currentBlock = queue.popFront()
IF currentBlock.type != targetType
CONTINUE
add currentBlock to result
IF result size >= maxBlocks
BREAK
FOR EACH neighboring direction
nextPosition = currentBlock.position + direction
IF nextPosition already visited
CONTINUE
mark nextPosition as visited
nextBlock = getBlock(nextPosition)
IF nextBlock does not exist
CONTINUE
IF nextBlock.type != targetType
CONTINUE
add nextBlock to queue
END WHILE
RETURN result
yeah maybe I'm not cut out for this
I was just going to use a set to avoid duplicates and not have to worry about tracking processed blocks but apparently in Js
A โ A
[1, 35, 3] โ [1, 35, 3]
hi
i have question
i am new developer of minecraft scripting
is typescript optional
Both JavaScript and typescript work but Ts is considered the better of the 2
You can't compare arrays that way
It is like comparing my room to yours, even if they are the same in every regard and have same content, they are different
Well I don't suppose there's like array.contents
I'm probably going to end up using encoded strings if that's the case
"x100y-40z3012"
What are you trying to compare arrays for
Well I was going to avoid duplicates via sets
But 2 arrays aren't the same so I may have to add strings instead
Use set?
location.add([1, 2, 3])
location.add([1, 2, 3])
This would still get added twice
Because the arrays are from different references
const dupNumbers = [1, 2, 2, 3, 4, 4, 5];
const numbers = [...new Set(dupNumbers)];
console.log(numbers);
// [1, 2, 3, 4, 5]
Just keep in mind this may not work in all types, so you may need to stringify
I'm going to encode it regardless
It makes sense to decode when it's needed
Hai
hi
hello
You should try using nodes
Like a node that may have a parent and some children
No because I already tried racking my brain with classes and constructors and vars in functions. It didn't go well
I'm too simple
Oka. But if done right it can simplify code a lot
If I'm struggling to make a basic offset system asking me to use nodes is like telling a preschooler to learn calculus
Well you can look at examples online. Just the basic implementation... Nothing to complex as to give you the answer
I think I'll just keep brute forcing my current method
A simple option for a simple guy
Oka. Jmm... That could get messy very easily. Well, good luck
I'm not trying to learn advanced programming for a simple task like a veinminer I could probably just download elsewhere for less features but actual functionality
Well this is the one I made... It uses the solution I said earlier...
Well at least my encoding works
And is not that hard to comprehend either, I myself didn't know about nodes this weekened
One problem less
Well it contains a class no?
And classes are complex
At least to me
Classes are objects with ribbons
Indeed
And that's too much for me
I can barely write a hello world program
It's a miracle I've gotten this far
Ha. You'll learn.
The most messy code you'll ever read
Did you know very block has a built in method to get its adjacent blocks
Don't need to use other system
Why not?
It gets more confusing than direction offsets somehow
Well you can make an array with all the blocks surrounding the selected one and iterate over them
block.offset() is less wordy personally, you can also change its xyz to your needs
If I'm struggling with basic directions and conditional loops why do you think that changing 1 method will magically solve all my problems
I said it because that could help you make things simpler
If I can't figure it out there is 0 downsides to dropping besides the cost fallacy effect or whatever they call it
Maybe im just not built to script
Yeah but 99% of developers are what they are because they're good at problem solving
I'm not
Anyways cya
Experience.
Besides I think if I wanted to copy someone else's work I would just do that from the Internet
Looking at a sample pack for ideas and yeahhhhhh no I'm not making that
I look up "simple veinminer" and apparently this is all required
If you'd like, I can give you a simpler version of this.t
I think I'm going to take a break from scripting for while
I have some issues I need to work through right now
๐
๐
lol.
Late response but teleporting is what I usually do to update it when nametag is modified so it shows on screen.
let players = world.getAllPlayers();
let spawnLoc = {}
players.forEach(ply => {
freezePlayer(ply);
world.sendMessage("player " + ply.name + " is now frozen");
spawnLoc.x = ply.location.x;
spawnLoc.y = ply.location.y + 10
spawnLoc.z = ply.location.z
storedPos.push(spawnLoc)
});
if (storedPos.length <= 1) {
world.sendMessage("need two player for titan fight")
}
spawnTitan(storedPos);```
Can somone help, ths is spawning all titans at same player
spawnLoc is the same object for every player, so every entry in storedPos ends up pointing to the last player's coordinates.
Just shift let spawnLoc = {}; inside the loop.
Or change storedPos.push(spawnLoc); to storedPos.push({...spawnLoc});
Also unless you're using specifically the last player's location for something. spawnLoc is kinda useless.
const players = world.getAllPlayers();
const count = players.length;
if (count < 2) {
world.sendMessage("Need two players for titan fight");
return;
}
const storedPos = new Array(count);
for (let i = 0; i < count; i++) {
const loc = players[i].location;
freezePlayer(players[i]);
storedPos[i] = [loc.x, loc.y + 10, loc.z];
}
spawnTitan(storedPos);
@golden holly
ohh
is typescript difficult??
thanks
@remote oyster @crude ferry
but Why didnt my work
it was doing the same thing
Objects share memory reference.
i have learned javascript but i dont have any idea for typescript
TypeScript helps catch errors while you are writing code instead of only finding them when you run the game or world. This gives you real-time feedback, such as warnings for missing properties, incorrect types, or invalid function usage. As a result, development is usually faster, debugging is easier, and you can avoid many common mistakes compared to writing only JavaScript. If you try to learn TypeScript (which I recommend), make sure you compile it to JavaScript because only JavaScript is supported in-game. Using TypeScript is purely for gain in development practices.
With proper knowledge of JavaScript, it's easy.
When you change the original spawnLoc, it reflects everywhere else.
๐
ohh so i also need to compile it. why is that so. typescript is on official page of learnmicrosoft.com.
TypeScript is not its own runtime language. It is just a layer on top of JavaScript.
TypeScript
function add(a: number, b: number): number {
return a + b;
}
JavaScript
function add(a, b) {
return a + b;
}
JS has two categories of types: primitives and objects.
Primitives cannot be modified in-place without creating a new one.
but is there any difference like some thing is only created by typescript
Katie types slower than my prof.
lol
lol.
TypeScript does not generate new capabilities for the game or engine. It only helps you while writing code. Everything it adds disappears after compilation.
Mobile; 1 hand atm
I feel that lol
Understandable.
How is it funny?
If referring to me, I was stating that I can relate and I did so with a sense of humor to lighten the mood....
@ the "lol"s
ohh. so can someone guide me how to start and from where to start (is learn.microsoft.com a good source)
#off-topic if it's gonna be taken personally....
did your hand get chopped off or something
I was naking sure you all knew that "lol" implies something was funny
Oh, of course. "Laughing out loud".
let ne wrap up what im doing irl
plz tell
@azure sentinel
@remote oyster
@snow pewter
also Discord for Android is broken on latest update
okay
so landscape mode isnt working?
Which keyboard is that?
you sure you dont have it locked
what phone is that
It's only Discord that is bugged out.
weird
okay i am also coming in few minutes
I can bring up the keyboard fine in another app.
This is what it looks like for me right now.
Is the app fully updated? Are you on Android? Did you tap the text box while holding it sideways?
On Android and the app is on the latest version
Might be related to the keyboard you are using.
Shouldn't be. Worked fine before updating Discord.
Try using the default keyboard to rule it out
And you didn't disable auto-rotate in your device settings, right?
Yea it doesn't behave like that on my end. Try using the original keyboard that comes stock on your device.
Odd. Modern software do be buggy these days
If that keyboard works fine then it's the custom keyboard you are using which is bugging out.
This is an old keyboard app, but this isn't the latest Android version either.
Still need to rule it out by testing with the keyboard that is stock for the device.
Keyboard or something. I hate how Google broke Android
Gonna get worse when they begin their transition to mimic Apple. Except it won't be functionally the same because Google is known to be incomplete when developing projects and then abandoning them to create another project which is essentially the same as the last one just reskinned lol.
As a power user, I already know that.
"Allo"?
typo?
No it was actually called Google Allo
Look are we going to talk about my phone which I'm not a dumb i**ot about or will we talk about the Script API here?
Did you check the stock keyboard to see if the problem persist?
The closest in name I recall is something by Google with Holo in its name.
Google Allo was an instant messaging mobile app by Google for the Android and iOS mobile operating systems, with a web client available in some web browsers. It closed on March 12, 2019.
The app used phone numbers as identifiers, allowing users to exchange messages, files, voice notes, and images. It included a virtual assistant that generated a...
I already answered that.
Where? I didn't see it.
โฆ
That didn't clearly answer the question. Looks like a random statement or opinion.
[It is the] keyboard or something. snip
.....
Custom Keyboard
broken on Discord
Stock Keyboard
broken or not broken (yes or no)
How dumb at tech do you think I am?
Also, how old you think I am?
I'm literally asking a yes or no question regarding your stock keyboard and you keep dancing around it.... I already know your custom keyboard don't work on discord because you showed a recorded video of it but you have yet to give a clear and precise yes or no answer regarding your stock keyboard.
I would have moved to this account sooner if not you all making me stay typing on that phone.
I answered. You didn't listen even after I pointed it out. Blocked.
No where does this say yes or no
Not even going to look at the messages. I'm not fond of people pestering me non-stop.
i am back
Blocking me won't hurt my feelings. You are welcome to do so.
Hello Crazy... Note that I am the same person as @azure sentinel (verify by looking at the bio of this account I'm typing from and that account I am pinging here).
... also note I'm going to be missing out on some messages due to being pestered nonstop as if they are intentionally trying to rile me up.
I'm aware it's you on both accounts.... Dancing around a yes or no question and claiming you gave a yes or no answer is what is actually crazy in this conversation lol
^ that one... whoever it is.
I only blocked because of them being extremely persistent as if I'm dumber than a Beta fish.
can you tell me do's and dont's while learning or while making an script behavior pack. i mean give me some advises. it will help me a lot
I am only used to JavaScript, not TypeScript.
Too many to list. It really depends on what you are doing.
it will be okay. for now i am also not doing typescript
Some of it could apply to TS, but do note that to set up TypeScript for use with Bedrock requires extra stuff... and most recommended is a Windows 10 / 11 (or Linux if you have it set up right) computer
TypeScript is a transpiled language, meaning it must be converted to another language to be used. It also heavily focuses on stuff being already "defined".
As in if something just came out and there is no defnintion for it, the TypeScript transpiler would complain.
i just want to make a cool server using js behavior pack like custom command, actionform (custom menus for shop or for other stuff), and the main thing newly introduced custom biome api.
JavaScript however is quite... prone to making errors with.
Though I should mention this immediately: Avoid LLMs for any sort of coding project whenever possible
To make a "cool server", you'd need a modified server software.
Start small. You will make mistakes, don't be afraid to Google the mistakes. Just make sure you take time to understand the mistake so it makes sense on why that mistake is actually a mistake. This will help you grow. Don't use AI as a crutch. It can and will make mistakes. It's ok to use it as a tool. If done so properly.
yeah i do have windows 10 laptop
Though I'd first recommend starting out making something basic.
It is pretty much a bad idea to dive into the deep end of a swimming pool without knowing how to swim, as they say.
i can confirm this 
@remote oyster ... Please try to be understanding next time. I'm not so good with what seems like people pestering me. I'll unblock you for now.
i thought about that but i also need that it will be based on bds so i can also add behavior pack if i need
then i listened about levilamina and endstone
they are best for vanila minecraft
but the problem with endstone is there is not huge library
Starting small and learning about how Add-ons themselves work should be relatively helpful.
For an example, you'd still need Add-ons for some functionality like certain types of custom GUIs to work.
and levilamina does update to latest bds after very much time
Yeah, no, Iโm not playing into that victim game. I was polite and calm the entire time. I was simply trying to assist and help by stating it would be wise to test the stock keyboard to rule it out, to determine whether Discord was actually the problem or if it was isolated to the custom keyboard. You then turned it upside down by insinuating that I was questioning your age and intelligence. Neither of which I did.
I'm not good with stress... you probably can understand how I've been riled up in the past and had to learn the hard way to block people.
Read my bio real quick.
I can probably guess what that is without Googling it. Apologizes for getting agitated so easily.
I'm not interested in games. I'm just here to help when I can. The drama is meaningless to me. Simply don't have time for it.
Breakfast so stepping away from the laptop (anf its account) to go eat.
Same myself. Getting the shakes.
Yes I'm good. As good as I can be.
feeling bad for you
PTSD here
bro enjoy life as much as you can
On top of high-functioning autismโฆ not the most fun of combinations
....
do you know about levilamina and endstone
I was literally about to DM you like last hour asking if it's true but I thought it might be offensive.
I am really sorry dude.
:(
D:
It's alright. No need to. We all have a clock looking down on us until this life expires. Some are just sooner than others. Tomorrow isn't promised. So live life each day as if it were your last because it could very well be your last ๐
:)
but uhhhh yeah idk if we (or at least i) can help with stuff like BDS that much, maybe in #1478215043601399818
My man is more enthusiastic than people who are healthy. Gotta learn from it actually.
No, it's true. Found out back in February.
I'm sorry.
Life works that way. Just have to learn to be content with the cards that are dealt.
i have run bds with 10 players for almost 2-3 months but they left one by one because they got busy
10 players doesnt sound bad
i often ran dedicated servers in other games and ive only got a full 32 players in the server for only once
it never happened again
When one knows their life is about to end, one of a few outcomes can happen normally:
- Feel down (causes body to weaken)
- Stay positive (allows the body to keep working better)
When feeling down, your immune system cannot properly function at full capacity.
This also applies for injuries and surgeries.
BDS is my preferred way. Just need decent CPU and RAM to handle the entities loaded in the world, all of the chunks that accumulate as players move around the world, and the number of players actively playing at any given time.
It's probably another reason why young ones get those candy after a blood draw or immunity shot at the doctor.
Keeps them not only distracted but also happy.
i am just a beginner @shy leaf
my advice? note down everything that comes in your mind
like a sort of brainstorming
you first start with ideas
Eactly. That's also adbice I give others (let me [eventually] head back to my room to type it out)
yeah i mostly like bedrock edition and their player i can make a java server but there are not much java players but bedrock community is huge
i have multiple thats why i am learning scripting
You will learn over time. As you learn you will find your self being capable of making more complex modifications. For now stick with the easy stuff. Nothing complicated. Simple, but functional.
i today only tried latest new dimension using latest beta api it was void world only but creating that was fun (and yes i took help of llm)
In case you don't know this is a great source for looking at the various API's out there.
Honestly, there was something called Minetest (now it is called Luanti) that not only had a lot more buildable space before JE expanded (still out-does both Minecraft versions vertically), it also had built-in mod support (like Bedrock's auto-download) and supported more platforms natively before Bedrock did
yeah i have also made a simple thing which was giving out a message in chat if every few seconds
The only downside for Luanti is if you try to compare it to Minecraft... you'll end up disappointed.
i learned scripting with just one motivation of turning an idea into a real thing, the result was crappy but it did gain attention to the point where i didnt expect it
so yeah youll get there
Luanti's website btw: https://www.luanti.org/
Wow, I didn't even realize I typo'd there...
Anyways time to type the advice in full.
btw where do you live i mean in which country
hello from south korea
This applies to various forms of creativity, from writing novels, to drawing, to ideas for games, etc. etc.
- Keep notebooks around as well as a pencil or something to write with.
- Write down any idea ASAP -- Don't trust your memory to remember it.
- Even if an idea is dumb, still write it down. This is an important one!
- With physical notebooks, even if lined, you can sketch out ideas as well (doing simple sketches works).
- Never, I repeat, NEVER destroy any ideas nor throw away any pages, just because you think they are not "good enough".
- Whenever you want inspiration, go look though your collections. Even the dumbest of ideas of your past can spark one amazingly creative idea in the future.
ohh
USA for me.
Airport code PDX or Portland International Airport always has the same time that I do (meaning I could live extremely close by, or anywhere else within the state that shares the time zone of it)
so you are still awake
was about to sleep
By the way, this still exists in Windows 11 somehow
ohh
whoops... forgot to blur or what-not the name
you are in 29 may 2026 i am still in 28
wait a minute
how did our mutual friend even happen
or did i mention this already
I have no idea... my memory is sub-par

I wish I was joking... PTSD is a real [BOINK!] of a problem
so you are still in morning
As shown form this screenshot I took a moment ago (IRL time)? Yes.
hmm
i always found this funny becuse all of us are on same planet but facing different times
Looks like Luanti got an update recently.
this is my time !!!
wth
(Note: the tab isn't built into stock Windows)
Katie ain't using the right channels!
It's called getting distracted and / or forgetting...
Going to move over to #off-topic
https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-net/httpclient?view=minecraft-bedrock-experimental why is the example duplicated ๐ญ
lol.
Should I install npm of latest server and server ui module or should I just use extension in vscode
extensions for json code and nmp modules for JS code
Okay tysm
Installation for @minecraft/server
Latest API module install:
npm i @minecraft/[email protected]
Beta API module install:
npm i @minecraft/[email protected]
Preview API module install:
npm i @minecraft/[email protected]
Preview Beta API module install:
npm i @minecraft/[email protected]
Installation for @minecraft/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]
has anyone benchmarked the cost of calling BlockVolume.translate()? is it simple property updating internally or is it doing more expensive calculations?
I wanted to but forgot to answer this last night lol.
If you are proefficient with JS. You don't have to "learn" TS.
Just do 3-4 projects and search when you are stuck.
Fun fact: Once you learn JS or any language. You don't have to "learn" any other language (maybe a little with low level languages tho.)
The thinking process transferrs.
Nah, if you started with JS, you probably want to learn data type, other languages is kinda strict about it.
Just because JS is dynamically typed doesn't mean it don't require knowledge of data types lol.
It just removes explicit declarations, not the concept itself.
eh this isn't exactly true, a lot of the basic knowledge does carry over but if you tried to switch from say JS to Rust, you'd very quickly run into issues with borrow-checking, strict typings, and so on
Well that's how it was for me learning Python, C and Java ๐คทโโ๏ธ
Though I can see that happening, yeah.
i have learned python and javascript
is there a way to detect whenever a player crafts an item?
Unfortunately no.
You can however check if an item has changed from an inventory so in theory you can make a very bruteforce way to check it.
If you plan to do it the bruteforce way (which you most probably shouldn't lol.) you might wanna use https://discord.com/channels/523663022053392405/1505049568574701593
But obviously this method has many quirks that you cannot really do anything about.
No body should ever learn java for the purpose of building new programs with it again, Kotlin is so much SO MUCH, soooo much better
you might wanna learn java if you want to dig through libraries that you're using or browse the source code from java mods or other programs, but you should never write code in java if you are just entering
I think the only reason to write anything in java is if you already know it, otherwise don't
dang, I'll look unto it thanks!
Still a javascript amateur: If something in an runInterval has a lot of math to go through and there's no need for it to happen in order, is that the time to use an asynchronous function for optimization?
Or is this moreso case by case?
No, Async only yields control when it is waiting for an external event.
An asynchronous function executes synchronously until it hits the first await.
should use job instead
I'll look into what generator functions are, thanks
Curious what your heavy Calc is
I'm also doing soemthing same
doing shockwave calculations.
It's simple on its own, but when there are numerous entities to check for, it starts slowing the whole thing down.
Realistically I'm only doing this for a minecraft map, so it's nothing I'm pressed about since I'm not really going to worry about high entity count for conventional gameplay, but I'd like to find any opportunity to optimize whenever I can.
there's an api like applyKnockback that acys like a shockwave by positioning where it starts "exploding" knockback
while applyImpulse is responsive to entity's position, or I'm wrong
Would anyone be interested in a Python util for mobile?
The script just zips and add-on and does some stuff to it.
Basically it takes an add-on path, it increases the version in the manifest. if specified, it runs the command "tsc" for typescript functionality. And then it zips the add-on, and opens a menu to open the mcpack with minectaft. Obviously it doesn't has typescript in it, nor the zip library, you would need to install those by hand
When you're on mobile and want to make an addon, there's no way of debugging it without importing it to minectaft. Everytime you want to do that, you need to change the version of the addon, compress it, and change the extension to "mcpack". Also If youre using TypeScript, you need to do the extra step to compile it to js.
So, for efficiency purposes, I did a Python script that does all of that automatically. Thats it.
It may not seem like much: "its just changing the versions number, compressing and changing the extension" but when you need to do this a lot of times, it gets boring.
Did anything change recently with dimension.findClosestBiome? I'm suddenly getting errors with this line but as far as I'm seeing it's unchanged ```js
const biome = dimension.findClosestBiome(location, currentBiome.id, {boundingSize: {x: 64, y: 64, z: 64}});
What the error
extremely useful don't act shocked
mmm, this part of my add-on have actually been broken for a very long time
I recall I had to use findClosestBiome and BiomeTypes.getall() in the past, but now I can just use dimension.getBiome();
Can you provide something useful
Like a getBiome function itself
And what did you pass as arguments for it
Oh , then use it
yeah, I don't think dimension.getBiome existed then
but it also had some other issues that I need to check
Lush Caves and the biome on the surface were completely flipped
I didn't even know it was something that was broken and I have no reason to use claudeAI to just delete a section of code and change 1 line lol
I use codex
? I am the only developer of RuneCraft
๐ซช
No i mean since when
I remember that UI is very familiar
I remembered that i've seen an image of it since 2023
2021
is there a better way to rotate canera around block without using camera:free with animations?
i tried to use it but now matter how many keyframes i add it does'nt move rights in the first and the last keyframe
i'm talking about that moves which outside the circle
they are in first and the last keyframe
I think that i'm doing something wrong
Since the V26 came out my scripts aren't working, i'm trying to fix the Tubby Custard Machine script but i think that i'm doing it wrong.
You're using an old scripting version.
ok
i'm not expert in the scripting topic. i think that a Dev Team could be good because i'm doing Slendytubbies Blockwar all by myself
We are at 2.7.0 now
creative inventory as in, before you take/spawn the item from creative tab?
i think i got that once, but i forgot how to resolve it...
Oh you already made it.
I thought you're asking how to make one.
You might wanna put it in #1072983602821861426 then.
Yes, but I was asking because I don't know if it will be worth it. Mobile development seems still a bit niche.
Pretty sure there are a lot of Mobile devs here so yeah you can.
do custom commands run on .runCommand()?
Yes.
Whot ?
you need to be more specific with "creative inventory"
https://jaylydev.github.io/scriptapi-docs/latest/classes/_minecraft_server.ItemStack.html#setlore
https://jaylydev.github.io/scriptapi-docs/latest/classes/_minecraft_server.ContainerSlot.html#setlore
Yeah but. I want it to be there in creative's is inventory
creative inventory is not really different though?
No i mean in the Equipment slot , construction slot
Etc...
I mean let s say the player searches for that item in the creative search section
And he hovers over it
nope, not possible
only when the item exists in world
Hmm ok
Is there a way to detect both backward movement and crouching? I wanna try adding a parry system where a player must "pull back" (move backward) and sneak at the same time
Thanks
Im assuming their still isnt a good way to make a custom fishing rod
Not to my knowledge
I just figured out something
What's that?
What's that?
"something"
And legends say he still never told what's something
๐
What is that sticker omg.
Someone named Hana taking notes
jumpscare
been looking for a minute and cant find an answer to this, is it possible to use scripts to give above vanilla enchants? Like sharpness x efficiency 20 etc
Only way I know how to do it rn is nbt editing players or villager trades which I'd rather not do for a BDS world
No, the script limits it too
damn that sucks, thanks
anyone got bug with includePassableBlocks: false, includeLiquidBlocks: true?
I can't detect liquidBlocks when includePassableBlocks is false
is there any ways to detect player movement such as wasd without the player moving?
Use inputInfo
And disable player control
The movement vector get updated regardless
input info detects that now? wasnt that just jump and sneak before?
oh that's inputButton
Not the event
Alright ima try it, thanks for the info Minato
Pretty sure that is the intentional design.
Liquid are passable blocks.
that liquid not block๐ฅฒ
Liquids are blocks.
Lol I misspelled intentional.
why they add this useless option
Its not useless. ๐ its useful for other blocks.
What should i use to cancel a player breaking/mining a block whether it is survival or creative
Before player break block.
Thanks !
how do i modify my script in game
whats the path to the behavior packs of my world
if any1 knows
you are not supposed to do that way, are you on mobile or pc device?
pc*
Get the item stack the player is holding
how can i filter that
unless...
๐ซช
No
const raycastOptions = {
includePassableBlocks: true,
includeLiquidBlocks: true,
excludeTypes: ["minecraft:tallgrass", "minecraft:yellow_flower", "minecraft:red_flower", "minecraft:vine"],
};```
These 4 are just examples. I am not sure about the entire list of passable blocks.
#announcements message
Why would you need something like that?
for checking if an entity is within spear reach
well at least thats my use case
Hm. If you wanted to go the extra mile, you could do the ray/box intersection yourself. The slab method is pretty easy to implement and you can use it to get precise distances
I followed this resource when implementing it for my project.
https://tavianator.com/2022/ray_box_boundary.html
What's cool is you could run this in parallel on a selection of mobs and have precise intersection results for each of them. You can that to know, in which order, a given line of mobs would be hit in
ooo
@shy leaf
hi
This page and other do have all codes in type script what if i dont want to code in typescript and want to write code in javascript where do i learn from and most imp that must be updated to latest beta api version (stable)
If you know JS. Reading TS without even learning it isn't that hard.
No.
ohh
If you cancel the damage then apply it again it would cause an infinite loop
yeah it did
You need to set some sort of variable to stop it on the 2nd turn
that doesnt somehow go for me tho
I already know TS so I cannot "unsee" it, maybe that's why lol.
I try to imagine what it'd be like to read TS for someone who only knows JS and it seems perfectly readable lol.
TYPESCRIPT CAN KISS MY ASS
HOW CAN NUMBER EVEN BE THERE???
ok finally fixed it, i forgot to account for nulls on dividers and labels
and the compiler was panicking cuz a type was a union ๐ญ
Ever since I've done only TypeScript for my main project, I have not gotten really any scripting related errors in-game
๐
typescript my beloved, saved me of having to always debug ingame for systax errors ๐

| true |
is there a before event for entity die
That's the closest. This isn't exactly "beforeDie."
Btw, this event isn't possible to cancel since when entity remove is called the entity has already died
If you want to cancel an entity death, use the beforeEvent for damage
When getting a block location, if a block is a chest, is possible to see if its a connected double chest vs a individual single chest?
i wanted to to smt with the inventory
thx
Isn't using entityRemove kind of bad though since this also triggers for entities that go out of render distance right?
*Simulation distance
And you are right yes.
Sim right..
What you can do is use entityHurtBefore event to check if the damage is fatal
Yes.
Can you point to me the documentation for that?
Get the inventory component and if it has 54 slots it's a double chest.
If it has 27 it's a single chest.
codex told me that as well, i was hoping for a better solution but thank you
okie
I don't think there's any other solution, really.
Or at least not to my knowledge.
You can bruteforce it of course by getting each block around it and checking it's permutation.
Thank you
Does anyone want a project developed by an experienced FiveM and Minecraft developer?
No
??
i have no idea either
๐ญ
everytime i compile, it just removes whatever new stuff i wrote
I don't understand what you're trying to describe.
i added new enums in a file
i compile the pack
VSC removes the enums and fail to compile
no logs about it either
How did you compile it? VSCode can't compile it. Did you use tsc?
im using regolith
oh hey look, type_gen filter is the one removing my enums
[INFO] Running filter type_gen
[INFO] [type_gen] Enum written to packs\data\gametests\src\Files.ts
...but HOW IS THAT EVEN RELEVANT
Someones been struggling with TS for the past day perhaps.
im on the brink of breaking a table
You need fresh eyes.
Iโll take a look at Bedrock-OSS/regolith; I havenโt used it before.
It looks like Bedrock-OSS/regolith is an add-on packaging tool.
yeah it is
I took a quick look at the Bedrock-OSS/regolith documentation, and it has a lot of features. But the config.json file seems pretty complicated.
I've recently been working on https://github.com/mcbe-mods/create, which offers similar functionality. If you're interested, feel free to check it out (it hasn't been published on npm yet).
bet
Do you use the enum?
Maybe regolith removes stuff you do not use
It's because that theyโre constant. Constant enums are inlined
also yes, as you can see above
Funny thing but I wonder why is location a property and getHeadLocation a method on Entity class lol?
probably because getting head location needs extra calculation?
since head location varies on entities
whats the best way to count specific blocks in a certain volume?
any better way than looping through 3 axis?
Use dimension.getBlocks
thanks ill try
yes
DARKOAK_STANDING_SIGN = 'minecraft:darkoak_standing_sign',
DARKOAK_WALL_SIGN = 'minecraft:darkoak_wall_sign',```
It's always nice when you're going through block ids in Minecraft to find out this is how they do the standing and wall signs for dark oak.
Everything else is labeled minecraft:dark_oak_ which is correct but for some reason they made these two darkoak instead.
W Mojang.. ๐ญ
Also take END_STONE_BRICK_DOUBLE_SLAB = 'minecraft:end_stone_brick_double_slab' for example.. everything so far has always been BLOCK_TYPE + _DOUBLE_SLAB but for exposed cut copper double slab it's: exposed_double_cut_copper_slab like why bruh ๐
๐
Does anyone have a stable version of Block.isSolid, since it is still in beta?
WHY IS POWERED RAIL minecraft:golden_rail ๐ ๐ ๐
I guess this is what happens when you go looking into minecraft properly
it kinda makes sense tho
Because it is made with gold
No
That's not normal ๐ญ
Can we rename redstone_torch to stick_and_redstone_torch then?
And every other item..
it's still a lot better than reeds
yh lmao
then why isnt golden rail named gold_stick_and_redstone_rail?
who knows
its the same logic tho
Still can't change my mind about these though.. cause this is just silly: ts DARKOAK_STANDING_SIGN = 'minecraft:darkoak_standing_sign', DARKOAK_WALL_SIGN = 'minecraft:darkoak_wall_sign',
I think that identifier was added before dark oak had an identifier anywhere else and they chose to go without the space
If they chose to match the texture names it would be big_oak which is even worse
Never mind, I just created my own stable version that actually works.
share?
It is not the same
hello,
Any optimized recommendations for limiting custom entities by zone or player? It would involve using world.afterEvents.entitySpawn.subscribe
Just stay away from stone_slab 2โ4

I think they are just different permutations
Is it possible to make an entity search for the nearest horse and raid it ?
yo did u ever find a way to do it cuz im trying to figure out the same thing rn
It seems there's no way to cancel the lightning strike. I think we could use "beforeEvent.entitySpawn" to save the current health, then add fire resistance for 5 seconds, and after the lightning deals damage, reset the health to its original level.
Why not use before entity hurt?
๐ง
how does sulfur cube interact with applyDamage and applyKnockback?
edit: as expected
Ain't no method to get an array of all occurence of an itemStack in a container?
Would have to loop through each slot perhaps.
whatcha trying
Nah I got it, it's fine.
Does anyone know how to get banner patterns and color
That is used in loot tables
import { world, system } from "@minecraft/server";
const spawnCheck = new Map();
world.afterEvents.playerSpawn.subscribe((event) => {
const player = event.player;
if (!event.initialSpawn) return;
const id = player.id;
spawnCheck.set(id, {
lastPos: player.location,
sent: false
});
const interval = system.runInterval(() => {
const data = spawnCheck.get(id);
// player left or already handled
if (!data || data.sent) {
system.clearRun(interval);
spawnCheck.delete(id);
return;
}
const current = player.location;
const dx = current.x - data.lastPos.x;
const dy = current.y - data.lastPos.y;
const dz = current.z - data.lastPos.z;
const moved = Math.sqrt(dx * dx + dy * dy + dz * dz);
data.lastPos = current;
if (moved > 0.05) {
player.sendMessage(`Hello ${player.name} in this Hello World tunudrunm lol`);
data.sent = true;
spawnCheck.delete(id);
system.clearRun(interval);
}
}, 5);
});
// Cleanup on leave
world.afterEvents.playerLeave.subscribe((event) => {
spawnCheck.delete(event.playerId);
});
is it possible to cancel the damage a hit did?
Entity Hurt Before Event.
same response lol
thx
Instead of canceling you can set the damage to 0.
world.beforeEvents.entityHurt.subscribe((event) {
event.damage = 0
});
Just another option based on preference.
yh i prefer this option
thxxx
Does this make knockback happen still?
Just a bit curious
To be fair, I can't remember. My short term memory is shot. So you would have to test and verify.
i mean it should
A shame
My version of the game is too low ๐ฅฒ
ill test it rq
Thats what I was thinking
yep everything its normal
u just dont take damage from the hit but u still take the knockback etc
Thank you ๐
I think I'll probably use that more often than event cancelling, for when i start using the beforeEvent, better suits my needs
theres just one problem
the knock back without damage its strange
another solution, if you want to keep the knock-back, is to give that player resistance level 250
that was the old method of canceling damage in maps
I dont really do vc, so is this ok?
Sure
There is still knockback after testing moments ago, but you can minimize that knockback pretty good with the following example:
import { system, world } from "@minecraft/server";
world.beforeEvents.entityHurt.subscribe((event) => {
event.damage = 0;
system.run(() => {
event.hurtEntity.clearVelocity();
});
});
Thanks ๐
I might do some experimentation with velocity to see if i can cancel the velocity that happens when the player is hit, instead of all velocity
Does getmovementvector work with movement input permission set to disabled?
it should
Weird.. latest preview did some very strange stuff. I have an item with a custom onUseOn component that is somehow causing a content log "read-only" error for a temp property in a completely different file. If I don't use the items on the ground, the error never fires and the code/temp property work as intended.
Actually. This file isn't even in a "read-only" section, it's a function ran in a system.runInterval
if (!player.__staminaTimeout) player.__staminaTimeout = 0;
That's all line 30 is, and it's not in a read-only function
Okay something is broken with all temporary properties
Commented out that entire file and tested another one using them
@valid ice You use properties like this too still, right? Can you see if the same thing happens to you
why not just cancel the event?
we want the classic knockback without damage
then, why using clearVelocity?
if u set the damage to 0 u get a strange knockback
like the knockback in zeqa in the gamemode sumo
but exaggerated
so, u want vanilla knockback and that's why u're not cancelling the event, but set damage to 0, but vanilla knockback is "strange" and u use clearVelocity to get no knockback at all
what's the point?..
better to have no knockback than a strange knockback
lol
then just cancel the event, bruh
i want the hit effect
wdym hit effect?
entity turns red
and critic
and i dont want to use any effect
so thats why
You should try and see first
Canceling the event interrupts part of the damage pipeline, which can delay hit feedback. It can also cause strange feedback if you have other scripts using the same event (I had to find this out the hard way). So what I shared above doesn't necessarily get rid of the knockback. It only minimizes the threshold so it's not overly dramatic when you hit the entity. You can see how dramatic it is if you test for yourself.
someone said this was a bug, they already fixed it in the preview
oh nice
guys what am i doing wrong here, im trynna make it so that when it rains, the player gets regeneration
const Odim = world.getDimension("overworld")
if (Odim.getWeather() == "rain") {
player.addEffect("regeneration", TicksPerSecond * 3, { amplifier: 0, showParticles: false })
}
the error says not a function at line 23 ( the "if" line )
is getWeather not a function or smth ๐ญ
maybe its still in beta idk
Use weather change event
Oh
import {world,WeatherType,TicksPerSecond} from "@minecraft/server"
world.afterEvents.weatherChange.subscribe(data => {
const {newWeather, previousWeather, dimension} = data;
const Players = world.getPlayers()
if(newWeather !== WeatherType.Rain) return;
for(const player of Players){
player.addEffect("regeneration", TicksPerSecond * 3, {showParticles: false})
}
})
test
100,000th message
Yess!
There's actually 300k messages
This indicator is actually bugged
Oh alright
It was once saying "999,999" when I was on the android app.
this message gets repetead a lot actually
getWeather is beta atm
(idk why but holy crap its painful)
You are probably the 500th person to point out the 100k lol. You won't be the last either.
I'm so dumb ๐ญ
You did not know something, and now you do. That does not make you dumb, that makes you learned.
Hey Guys i'm trying the new CustomForm script api but i can't get it to work, here's my code and manifest
{
"module_name": "@minecraft/server-ui",
"version": "2.1.0-beta"
},
world.beforeEvents.playerBreakBlock.subscribe((e : any) => {
system.run(() => {
log("hi")
const player = world.getPlayers()[0];
/*const toggleValue = new ObservableBoolean(false, {clientWritable : true})
toggleValue.subscribe((v : boolean) => {
log(`value changed to ${v}`)
})*/
try {
const form = new CustomForm(player, "test");
form.button("test button", () => {
log("button pressed")
//toggleValue.setData(true)
})
//.toggle("test toggle", toggleValue)
.show()
} catch (error: any){
log(error)
}
})
})
i get the error: Invalid constructor called (on the line where CustomForm is made)
i also can't create an ObservableBoolean, when i try to says something about not a function at anonymos or something
also i'm playing on the 1.26.21-stable
This is for 26.30
Make sure you read the right docs next time.
What's causing these dataDrivenEntityTrigger events to happen in a normal world? I just made an event logger to check what events are running.
I don't quite get the entities healing are health change either. Do these trigger just from them spawning?
it triggers when entity custom event is triggered, for example if entity has something like this in json ```json
"events": {
"minecraft:entity_spawned": {}
}
Ah, gotcha. That'll be quite a lot then.
I guess it would be good to filter that event out then. I already filtered out the playerButtonInput event since that would spam from jumping and sneaking.
creating Observable is like
Observable.create(true, {clientWritable: true})
So you don't need to manually import all types of observable
And custom form like this:
CustomForm.create(player, "Form Title")
Which is changed in 26.30 fyi which releases in 2 weeks.
Oh
Thankyou
Too bad that these forms are in OreUI, would have made some very nice uis if it were json ui
anyways to move an itemstack player mainHand to another entity's ? getcomponent(equippable) isnt working at all on anything other than player
Not really no without losing data.
damn rip
Isn't there a transferItem method
Thats only for containers.
What ๐ญ
Why would I import react js. I don't even have any imports like that.
Okay this got to be some VS Code auto complete.
Yeah it is.
Use a command to id the item. ```// POLL MAIN HAND: Utility
function pollMainhand(entity) {
// FRAME ITEMS TO DETECT in TARGET ENTITY
for (const typeId in EVOLVE_MAP) {
entity.runCommand(tag @s[hasitem={item=${typeId},location=slot.weapon.mainhand}] add phantom:has_required_item);
if (entity.hasTag("phantom:has_required_item")) {
entity.removeTag("phantom:has_required_item");
const item = new ItemStack(typeId, 1);
return item ? item : { typeId: "minecraft:air", getTags: () => [] };
}
}
// check player via API
// if the item is not caught in MAP Above, return `air` for frame entity (no `equippable` component)
const equipment = entity.getComponent("minecraft:equippable");
if (!equipment) return { typeId: "minecraft:air", getTags: () => [] };
// continue for player only USING API
let item = equipment.getEquipment(EquipmentSlot.Mainhand);
return item ? item : { typeId: "minecraft:air", getTags: () => [] };
}and the EVOLVE_MAP looks like this in my code... const EVOLVE_MAP = {
"minecraft:mob_spawner": 1,
"minecraft:armor_stand": 2,
"minecraft:empty_map": 3
} ``` You can then use pollMainhand for BOTH entities and Players.
so now the item is returned and you can give it to whomever
its not exactly what you need but the concept is workable.
i needed to give a weapon to a custom entity and back
ig this is useful getting non tools and stuff
i added a behavior pickup it works as long as i drop the weapon near the custom entityy
Understood. Have you looked at EntityComponentTypes ? There is a different way to access equippable for entities than for players. ``` import { EntityComponentTypes, EquipmentSlot } from "@minecraft/server";
// This works flawlessly on both players AND standard mobs (like custom item frames or armor stands)
const equippable = entity.getComponent(EntityComponentTypes.Equippable);
if (equippable) {
// Directly targets what the entity is visually holding in their main hand!
const heldItem = equippable.getEquipment(EquipmentSlot.Mainhand);
}
Java Edition has a seperate air block called minecraft:cave_air as its turning out.
Istg I got so happy and then I realised it's Java Exclusive.
I am trying to detect caves.
It seems impossible to do precisely.
Okay locating a lush cave can do something.
isnt EntityComponentTypes just Enum that gives the same "minecraft:equippable" ?
Trial chamber, Ancient City, and Deep Dark too perhaps.
could use dimension.getBiome
Perhaps
Whoaaa
Thankuuuu
Ohhhhh
Yeah sort of. But entities do not have "minecraft:equippable" they have "EntityComponentType.equippable" worth a shot unless you have exhausted that already.
ah thanks ill check when i can try it
Yeah but that can sometimes be hundreds of block away.
Not that bad but I will try to create some algorithm to detect caves before using that solution.
can u use issolid with air?
Yes.
than u can use that to detect caves
Sure but it can choke on small notches that generate quite frequently.
I think I will check for air underground and then take a block volume around it and check how much Air% it is.
yh thats smart
@crude ferry I'm sorry to jump in... cave detection is an interesting issue. If you are writing custom script behaviors, are you looking to track a player's environmental depth (like checking ambient lighting and sky-exposure), or are you trying to hook into custom underground biomes like Dripstone or Lush Caves? I guess what I'm saying is it sounds like you are detecting specific procedural cave gen. No? Can you not just scan for those unique and specific blocks underground? Like dripstone copper bulbs or glow berries? Or is this some kind of teleport situation?
I agree with you though, cave air would be easier if we had it.
I am just trying to create a script which can detect a cave without hooking it onto vanilla structures all the time. There are many ways (like the Air% one.) but they have very low accuracy and I am trying to get around it. I am creating something that finds the nearest cave to a player. There's no preference of large or narrow caves. Both are equally important in my use case.
@crude ferry I see the issue... That's much trickier than it would appear isn't it? Water, lava, collision, cavities that may register as caves if the systemic checks you have are too small. Are you planning on clearing out blocks in the area that is chosen? Maybe an air structure could work in such a case. Basically get close enough, then drop a mostly air structure in the spot you selected. Structures can be set broken too so it isn't some strange cube shape. But that takes some of the challenge out of the clean discovery, doesn't it.
"Are you planning on clearing out blocks in the area that is chosen?" Why would I do that lol? I don't see the point in that one.
You said you are moving a player to the nearest cave. It can be any shape. Well... I can grab a cave in a structure. Multiple caves even. Then fake carve my own in real time before moving the player. That's all.
Oh.
This way the player is never moved say right above water or lava
That's genius ๐ญ
Thanks!
Like it didn't achieve the real task of detecting caves but faking one of my own actually fits what I am trying to do lol.
And takes away the chance of accidently getting a player in an unwinnable situation. You are in total control. Later
Alternatively ``` import { world, system } from "@minecraft/server";
/**
-
Places a pre-saved structure at a given location.
-
@param {string} structureName - The name of your .mcstructure file (e.g., "mystructure" or "mystruct:house")
-
@param {number} x - X coordinate
-
@param {number} y - Y coordinate
-
@param {number} z - Z coordinate
*/
function placeStructure(structureName, x, y, z) {
// Wrap inside system.run to safely modify the world context
system.run(() => {
const overworld = world.getDimension("overworld");// Formulate the Bedrock /structure command string const command = `structure load "${structureName}" ${x} ${y} ${z}`; // Execute the command asynchronously overworld.runCommandAsync(command) .then((result) => { console.warn(`Successfully placed ${structureName} at ${x}, ${y}, ${z}`); }) .catch((error) => { console.error(`Failed to place structure: ${error}`); });});
}
// Example usage: Spawns a saved structure at coordinates 0, 64, 0
placeStructure("mystructure", 0, 64, 0);
Those should point you in a good direction. ๐
That wouldn't quite work for vanilla structures.
That is like, not at all what they asked for.
Oh sorry smokey.
any limit in world.setdynamicproperty?
32k bytes
is it possible to cancel the message when someone leaves/join
Thanks
Where do we get that information from?
Yeah, just wanna annoy yall
hope they add typescript support in scripting
do we have improved method to make block display entities?
or is it still the good ol fox method?
you can already code in typescript?
Wym
you can code in typescript with the scripting api
you just need a compiler
then we still can't really run typescript in Minecraft, you still need to transpile it
But I'm curious about what you mean
how
its really convient if you want proper types and not just guessing when you have objects or interfaces
this is just something random
interface myData {
participants: ScoreboardIdentity[],
scores: Number[]
};
function getScoreBoardData(player: Player | Entity, objective: ScoreboardObjecive | string): myData {}
Oh yeah I understood this, it's just I'm talking about typescript working as we enter the world, so we don't have to reinstall packs every time we make changes
oh well you dont need to do that
just reload
it works the same way
It's not strict as ts tho, but yeah that works
It is possible to both work within TypeScript and to have hot /reload work.
If a behavior pack is located in either the development_behavior_packs folder or in a world file directly, then you can use /reload to quickly access changes.
Packs located in the regular behavior_packs folder (such as when importing a .mcpack or .mcaddon file) will get copied to a world when applied, and that would explain the need to reinstall them
if i remember correctly
sapi uses quickjs
quickjs runs on js unlike bun
yeah
How could I make a particle circle
actually, they're the same, that thing is just a enum, it also returns a string.
this draws an expanding circle, here you have:
function* drawCircle(radius:number,center:Vector3,dim:Dimension){
for (let delta = 0; delta < 2*Math.PI; delta +=1/(2*radius)){
let cx = center.x+radius*Math.sin(delta)
let cz = center.z+radius*Math.cos(delta)
let pos = {
x:cx,
y:center.y,
z:cz
}
let particleConfig= new MolangVariableMap()
dim.spawnParticle("minecraft:soul_particle", pos, particleConfig)
yield
}
}
Thank you
It exists.
๐ read the docs
why u keep sending this image
mb, I'm relieving stress and had too much dopamine that I randomly do this, or idk .
I keep laughing at this alone
just blocked the guy
The changelogs.
Truth nuke.
Is it going to be preview or stable next? ๐ค ๐
I NEED MORE SCRIPT API EVENTS AND FEATURES!!!
It isn't funny omg.
changelogs share this kind of information?
Because I cant find anything related to the 26.30 release
Check the previews.