#Script API General
1 messages · Page 6 of 1
Item.nameTag = "idk"
also how do i define player cuz i tried with player = world.getallplayers
Didn't knew it's that simple, lol
It is
thanks :)
Uw
system.runInterval(() =>{
for(const player of world.getAllPlayers()){
const inventory = player.getComponent("inventory").container
const item = inventory.getItem("")
const rename = item.nameTag("idk")
}
})
here, but someone correct me if am wrong
one thing you forgot that you have to setItem after modifying itemStack
Implement this and it works great!
A self reminder: I should use ContainerSlot.nameTag = "Something"
Thanks
oohhhh
- nameTag is not a function
item.nameTag looks more like a property than function tho..
Thanks for the effort :)
import { world, system, Player, ItemStack, EquipmentSlot, World, } from '@minecraft/server';
import { ActionFormData, MessageFormData, ModalFormData } from "@minecraft/server-ui";
world.afterEvents.itemUse.subscribe((i) =>{
let player = i.source
const itemStack = i.itemStack
if (itemStack.typeId == "minecraft:heart_of_the_sea") main(player)
})
const player = world.getAllPlayers()
function main() {
const form = new ActionFormData()
.title("§l§dModration Menu§r")
.body(" §l§aby Maxis")
.button("§lkick")
.button("§lwarn")
.button("§lmute")
.button(`§cExit Menu`);
form.show(player).then(r => {
if (r.selection == 0) kick(player)
if (r.selection == 1) warn(player)
if (r.selection == 2) mute(player)
})
}
function kick() {
new ModalFormData()
.title("Kick Menu")
.textField("", "Reason for Kick")
.dropdown("Pick a member", player.map(player => player.name), 2)
.submitButton("done")
.show(player).then(r =>{
let input = r.formValues[0]
if (input) {
player.sendMessage(`${player.name} Has kicked a player for ${input}`);
} else {
player.sendMessage(`${player.name} Has kicked a player for no reason.`);
}
})
}
function warn() {
new ModalFormData()
.title("")
.textField("", "Reason for warn" )
.dropdown("Pick a player to warn", player.map(player => player.name), 2)
.submitButton("done")
.show(player).then(r =>{
let input = r.formValues[0]
if (input) {
player.sendMessage(`${player.name} Has warned a player for ${input}`);
} else {
player.sendMessage(`${player.name} Has warned a player for no reason.`);
}
})
}
function mute() {
new ModalFormData()
.title("")
.textField("", "Reason for mute")
.dropdown("Pick a mute", player.map(player => player.name), 2)
.submitButton("done")
.show(player).then(r =>{
let input = r.formValues[0]
if (input) {
player.sendMessage(`${player.name} Has warned a player for ${input}`);
} else {
player.sendMessage(`${player.name} Has warned a player for no reason.`);
}
})
}
Could someone help me define player
give it param
np did it on the fly
Yes
am confused i did
?
Put mute(player)
player is a parameter
In all the three ones
Add player as Parameter in them
i tried that but does not seem to work for some reason
hmm
if (r.selection == 0) kick(player)
function kick() {
...
}
You've passed a player param but you've never set a reciever in the functions definition
Yes it must be
function kick(player)
{}
did you try adding any checks for player, like, if (!player) return
could you go though my code and give me a example
you just have to do this
function kick(player) {
new ModalFormData(player)
.title("Kick Menu")
.textField("", "Reason for Kick")
.dropdown("Pick a member", player.map(player => player.name), 2)
.submitButton("done")
.show(player).then(r =>{
let input = r.formValues[0]
if (input) {
player.sendMessage(`${player.name} Has kicked a player for ${input}`);
} else {
player.sendMessage(`${player.name} Has kicked a player for no reason.`);
}
})
}
like this right?
Yes
yup
i still get errors
And warn and the others
What s the error?
and remove const player = world.getAllPlayer() cuz that will return array
world.afterEvents.itemUse.subscribe((i) =>{
let player = i.source
const itemStack = i.itemStack
if (itemStack.typeId == "minecraft:heart_of_the_sea") main(player)
})
const allPlayer = world.getAllPlayers()
// ^ Rename this to avoid confusion
function main(player) {
const form = new ActionFormData()
.title("§l§dModration Menu§r")
.body(" §l§aby Maxis")
.button("§lkick")
.button("§lwarn")
.button("§lmute")
.button(`§cExit Menu`);
form.show(player).then(r => {
if (r.selection == 0) kick(player)
if (r.selection == 1) warn(player)
if (r.selection == 2) mute(player)
})
}
function kick(player) {
new ModalFormData()
.title("Kick Menu")
.textField("", "Reason for Kick")
.dropdown("Pick a member", allPlayer.map(player => player.name), 2)
.submitButton("done")
.show(player).then(r =>{
let input = r.formValues[0]
if (input) {
player.sendMessage(`${player.name} Has kicked a player for ${input}`);
} else {
player.sendMessage(`${player.name} Has kicked a player for no reason.`);
}
})
}
function warn(player) {
new ModalFormData()
.title("")
.textField("", "Reason for warn" )
.dropdown("Pick a player to warn", allPlayer.map(player => player.name), 2)
.submitButton("done")
.show(player).then(r =>{
let input = r.formValues[0]
if (input) {
player.sendMessage(`${player.name} Has warned a player for ${input}`);
} else {
player.sendMessage(`${player.name} Has warned a player for no reason.`);
}
})
}
function mute(player) {
new ModalFormData()
.title("")
.textField("", "Reason for mute")
.dropdown("Pick a mute", allPlayer.map(player => player.name), 2)
.submitButton("done")
.show(player).then(r =>{
let input = r.formValues[0]
if (input) {
player.sendMessage(`${player.name} Has warned a player for ${input}`);
} else {
player.sendMessage(`${player.name} Has warned a player for no reason.`);
}
})
}
If u won't to iterate through all the players
I believe that is used for the dropdown menu
Wait
Yeah changing player const won't make difference too !
Remove it from the script
Remove :
const player
Unless u need it , rename it
ohhh
oh let me look
First did u apply the changes ?
yes
when i debug there are no errors
Hello family. I've learned a lot lately about the Minecraft+Javascript execution flow. It's very strange but interesting.
I didn't know that there were equal events for pre-world modification and post-world modification. Even the callback function argument refers to properties that refer to different things.
I did not imagine that the same structure could refer to two different states of a coordinate. Pre and post.
:3 and very interesting how each flow is associated with each tick. And how a tick function is executed from a local scope and has no lift.
Anything with a 's' on the end is going to return an array of what is before the 's'. Pay attention to those details.
is it possible to get itemStack inside a shulker box itemStack??
(shulker box in inventory/not placed)
Nope
I have an anomalous behavior, when I place a block and remove a block periodically for some reason the block that is placed is the one in the position of the one that was removed, in this case ai air. Do you know if it's a bug?
The drop methods are both inside an instantiated object.
If you are using beforeEvents, then the block is gonna be air
Check the permutationBeingPlaced property in that case
I do not mean that. I think the problem is the constructors. I don't know how they carry the information exactly.
It is better to use the afterEvent for that.
I was already able to summarize the anomalous behavior: it places a block in one position but extracts it from another position from which it should not.
But I don't understand exactly why it happens. If you like, I'll give you the code. A small part.
Ok lets check it out
Wait, I'll transcribe it.
class Head {
constructor(blockGen, blockGrow, direction){
super(blockGen.location);
this.blockGenerator = blockGen;
}
placeBlock(){
mundo.setBlockType(this.location, this.blockGenerator.typeId);
}
forward(){
this.placeBlock();
this.tail.destroyBlock();
}
}
Something like that.
To avoid complications, I didn't put the tail and all that.
:'v tail has its own position, also head. But head does strange things: it takes the block at the position of the blockGen (block that had the coordinate that was assigned to head) and places it in the place where I should place the block that was.... Wait, I see something.
It is an object with properties x,y,z
Yeah... I'm not understanding well what you are saying, but I might have an idea of whats happening
Wait, I see what blockGen was in the beginning.
Oh, I thought I already saw the error. Confirm if it's true:
When do I run the event after the player place. Block calls the callback function and returns an event element from its arguments, correct? Well, that object has a "block" attribute. No?
I just realized something. It behaves dynamically I think.
Most of the Block class properties are getters
If I call a function that is executed every 2 ticks within the callback, it changes the block values.
They will return the current value every time you call them
Here when creating the object you assigned the e.block, see? Maybe it is the Failure
Oh. I'll do some tests.
I'm back, you were right, the block methods are getters and will give the current state. Bug fixed.
:v How did you duplicate objects to unbind them from the server's hands? XD
While you help me I will see with Object.assign();
Save the values in variables or an object
You can do this```js
const info = {
typeId: block.typeId,
location: block.location,
permutation: block.permutation,
}
TnT I don't want to
I can't create an object from Minecraft classes? How does an object like that look? What default values do you have?
What?
Hello guys! another question
is it possible to give items an enchanting glint through scripts?
No, next question
alright then
If possible. I know how to do it, I'm better than RedTNT
To execute it I can devise many ways, although the important thing is to know if we can execute commands from the Script, it would be the most comfortable ways.
sure
Bruh
Not sure if saving the item in a mcstructure and editing the NBT would work
Not sure if thats a property that can be edited trought NBT
I didn't say that was an option. I didn't even think about it, but I don't doubt it works.
You seem like someone without much engineering experience. You just complicate your head with your ideas. Yes Did you know that there is a command to enchant objects? At least the basic ones, and those that have the enchanting property.
Does anyone know how I can override this behavior? I'll be investigating.
I do know the command but they just wanted the enchanted item glint
And not every item is enchantable
:v you can't do it with a script xD
Thats what I said
Although I think I know an esoteric method.
guys how to use / on script, i mean like runCommandAsync(`function/a/b/c`)
\/
okayy thanks
It is a special character for strings in Javascript.
Mdn Mozilla.
ok just \
Yes
Yes
okay thanks
Why do you use ` ? Xd
Just use it like that
Whats the problem?
[Scripting][error]-Unhandled promise rejection: CommandError: Syntax error: Unexpected "/": at "oad abc:de>>/<<miaw"
idk error
I get it, try with runCommand('function "a/b/c"')
:b
same
What is the syntax of the function command? I forgot her.
XD Are you seriously asking for a string?
nvm
:'3 ❤️
player.runCommandAsync(`structure load ${selectedStructure}`) what abt this
I think you forgot the coordinates
The code inside the curly braces is evaluated and inserted at the text position.
Abt? About?
const selectedStructure= [
"abc:ab/miaw"
]
I spoke well, stupid.
XD
XD Does the structure command load arrays?
player.runCommandAsync(`structure load ${selectedStructure[0]}`)
That itself had to be corrected.
I'll go solve my linking problem
not working😭
This does work completely fine for me
const structures = [
"abc:ab/miaw0",
"abc:ab/miaw1",
"abc:ab/miaw2"
];
selectedStructure = structures[Math.floor(Math.random() * structures.length)];
player.runCommandAsync(`structure load ${selectedStructure[0]} ${block.location.x - 2} ${block.location.y} ${block.location.z - 2} 0_degrees none true true true`);

Try with mystructure: instead of abc:
I can't, I put the structure in a folder :>
So why did you pass it a string before? Ha ha
Wdym
The command is wrong, it has a string inside. I doubt that Minecraft commands have a string.
"${selectedStructure}"
Place this one:
Better wait, I'll check the documentation. To see the command.
This is one I just made
-_-

@knotty plaza You're right, I'll have to extract the data from the object: what a shame.








how to use .setProperty?








It works like block states
This is from the bee json file```json
"minecraft:entity": {
"description": {
"identifier": "minecraft:bee",
"is_spawnable": true,
"is_summonable": true,
"is_experimental": false,
"properties": {
"minecraft:has_nectar": {
"type": "bool",
"client_sync": true,
"default": "query.had_component_group('has_nectar')"
}
}
}
You have to set the property first
Then you can change it from the script
The first parameter is a string
entity.setProperty('key', 1 /* The value */)
import { Player, world } from "@minecraft/server";
world.afterEvents.entityHurt.subscribe(eventData => {
const player = eventData.damagingEntity;
const entity = eventData.hurtEntity;
if (player.typeId === "minecraft:player") {
player.runCommand("say hi");
}
});```
why does this^ give me this error
[Scripting][error]-TypeError: cannot read property 'typeId' of undefined at <anonymous> (main.js:7)
const player = eventData.damageSource.damagingEntity
Didnt i tell you yesterday? DamageSource isnt an entity
he is using damagingEntity directly
and that's not a property for the eventData
Ik, i already told him yesterday
People should really read the docs
yeah
anyone know what this means?:
libc++abi: terminating due to uncaught exception of type std::length_error: vector
[2024-07-26 12:40:18:872 INFO] Package: com.mojang.minecraft.dedicatedserver
Version: 1.21.2.02
OS: Linux
Server start: 2024-07-26 12:40:07 UTC
Dmp timestamp: 2024-07-26 12:40:18 UTC
Upload Date: 2024-07-26 12:40:18 UTC
Session ID: ca141809-bf5e-41a3-879d-ed8414f4a216
Commit hash: 50d69ddfd20afc969dbcb5826bbf80368ebf9044
Build id: 25836814
CrashReporter Key: 8c4937c1-64cb-3532-a8dc-1deb28f67293
Crash
[2024-07-26 12:40:18:872 INFO] at gsignal (UnknownFile:?)
at abort (UnknownFile:?)
at __clone (UnknownFile:?)
a9e9ee6a-6834-47f0-adcb-bcfb1a747922
container@pterodactyl~ Server marked as offline...
[Pterodactyl Daemon]: ---------- Detected server process in a crashed state! ----------
[Pterodactyl Daemon]: Exit code: 1
[Pterodactyl Daemon]: Out of memory: false
[Pterodactyl Daemon]: Aborting automatic restart, last crash occurred less than 60 seconds ago.
i just used my addon on my server and after some time the server keeps crashing with this message
eventData.damageSource.damagingEntity
you are accessing damagingEntity through damageSource
there is no damage source in the code
:/
You literally had it
And I told you damageSource isnt an entity but an EntityDamageSource
this is the updated code
I changed the thingy and you're looking at the old code
Ik...im telling you that damageSource exists
You had it right, but its not an entity its a EntityDamageSource
how to I get the player who hit the entity
Try asking your server hoster?
@abstract cave :/ i already told you
Since it isnt an entity, its a EntityDamageSource. Youll need to get the objects properties
The addon causes that
Also crashed my singleplayer world..
Open a post then?
check Dms @abstract cave
'kay
what is that for?
can you send me docs? sounds interesting
- I don‘t have the docs
- It doesn‘t work that‘s why I‘m asking for help
why I have an error in this file
probably DataView is not available on scripting api
how can i tp some one in a specific dimension?
Why am I unable to import BlockAreaSize from „@minecraft/server“?
Block volume? You have link to docs?
Your using
Yes
Idk, I used it in 1.19-1.20 with no problems but now it throws the error that it can‘t import it from „@minecraft/server“ so maybe they replaced or removed it?
Probably changed if it no longer shows valid. I would look at the current docs,
Alright ty
is there a similar event like onRandomTick from block custom components? basically i wanna make vanilla crops die randomly when the player isn't near
No
oh so like, it's not possible to do so aswell?
Why is is the net module only for BDS ?
Thats just the restriction they gave
Okay ty, you mind if i ask you something else
Sure
i want to manipulate the player properties by using this
Object.defineProperty(Player, "isStaff", {
enumerable: true,
configurable: false,
writable: true,
get: function() {
},
set: function(state) {
}
});
is this how it works?
(because i want to make my own anti cheat and i need some methods i can call quickly)
Yeah, you can do that
There's also value(params) for if you want it to be a method and not a property
okay nice ty
I do soomething like this here:
Object.defineProperties(Player.prototype, {
methodThingy: {
value(param1, param2) {
const added = param1 + param2;
return added;
}
},
propertyThingy: {
get() {
return this.getComponent('equippable').getEquipment('Mainhand');
},
set(item) {
this.getComponent('equippable').setEquipment('Mainhand', item);
return item;
}
}
})```
thanks 👍
and a .d.ts file helps with intellisense on those!
alright thanks
Can someone help me? How do I disable the effect particles here, type true at the end of the mcpe command:
player.addEffect('slow_falling', 300, { amplifier: 2 });
?
player.addEffect('slow_falling', 300, { amplifier: 2, showParticles: false });
can you call another constructor of the same class? like lets say
class test {
main() {
if (something) //run secondary
}
secondary() {
...
}
}```
You mean a function? What exactly are you trying to achieve?
U mean two constuctors ?
That s impossible
ah i see
What u wanna achieve?
i just wanna split up some code to make it visually easier
class Test {
constructor() {
this.main();
}
main() {
if (this.something) {
this.secondary();
}
}
secondary() {
// Your secondary initialization logic here
console.log("Secondary method called");
}
}
// Example usage
let testInstance = new Test();
class Test {
constructor(param) {
this.initialize(param);
}
initialize(param) {
if (param === 'main') {
this.main();
} else if (param === 'secondary') {
this.secondary();
}
}
main() {
console.log("Main method called");
// Your main initialization logic here
}
secondary() {
console.log("Secondary method called");
// Your secondary initialization logic here
}
}
// Example usage
let testInstance1 = new Test('main'); // Calls main method
let testInstance2 = new Test('secondary'); // Calls secondary method
im still pretty confused what does this actually mean
this = the class
super = the class or the parent class , or one level superior element in the prototype chain
ohhhh, man in W3Schools all i could read was a bunch of this
Ok easily
this refer to the object
Like if :
let object = {
J : 5,
B : this.J }
this refer to the object
ohh, yeah, i understand now
- this is defined in the run Time
- u use this instead of object name
Because when u want to make copies of that object
u can't as example put :
let object = {
J : 5,
B = object.J }
When u make new instance of it
The instance inside will looks like this :
let instance = Object.create(object);
/// Instance would look like :
instance= {
J : 5 ,
B = object.J }
Let s say object is now not defined anymore
That will make a huge problem
so use this
To solve it
And this will be replaced internally with the new object name
i see, i think i now have a clear understanding of classes and gained 3 iq points
"this" can refer to a lot of thinks
you can use it in objects classes functions prototypes (in html you can use it to refer to the window)
so this is basically just the object so it doesn't matter if i rename the object it will still adapt
oh, i thought it was just for classes lmao
Liek this gets its context from run Time excution
function customization(player) {
const form = new ActionFormData();
form.title("@customization.title");
form.body(
{ translate: "@customization.hair" },
{ text: "/n/n" },
{ translate: "@customization.skin" }
);
form.button("@customization.button_1");
form.button("@customization.button_2");
form.show(player).then((response) => {
switch (response.selection) {
case 0:
player.runCommandAsync("event entity @s spark:change_hair_back");
customization(player);
break;
case 1:
player.runCommandAsync("event entity @s spark:change_hair_next");
customization(player);
break;
}
});
}
Can anybody tell e why my form is not opening and saying that;
[Scripting][error]-TypeError: Incorrect number of arguments to function. Expected 1, received 3 at customization (@NS/test.js:22)
at <anonymous> (@NS/test.js:9)
problem with .body()
i mostly use it in prototypes
for example in my isCrawling prototype "this" refer to the player
import {Player} from "@minecraft/server"
/**
* Checks if the player is in a crawling state based on distance between his head location and his feet location.
* @return {boolean} true if the player is crawling, false otherwise
*/
Player.prototype.isCrawling = function () {
const distance = this.getHeadLocation().y - this.location.y
return distance < 0.31 && !this.isSwimming && !this.isGliding && !this.isSleeping;
};
- how to use:
put the code above in your script.
//return true or false as mentioned in the jsDoc
if(player.isCrawling()){
player.sendMessage("Stop crawling like a baby :p")
}
But, seems that nothing is wrong
Wait a min
i see, this is using the player as the object
yeah i think the body must only have 1 argument, try putting it in a brace like
.body({your stuff in here})
- Don't forget
check this conversation for more examples
https://chatgpt.com/share/75d9d713-d455-478e-b4ff-0b30318765b8
functions has its this too
oh, i get what prototype means, it adds stuff to the object
class*
Prototype is just a proprety that all objects share
Like static propreties
Instead of making new propreties every time u create new obje6
ah, alright
Like if three object has
A proprety called :
PI : 3.14
Just put it in the prototype
To make them all share it
Instead of making new copies of it
ohhh, i thought it's used to add new things to an object, like if i wanted to add a new method the player
Yes , but not its real usage
Because when u want to make a class or constuctor function
U must put all properties that can be shared in it
To save ur ram from lacking
i see, also is the script speed depended on the ram of the device/host server?
huh
how can that cause a memory leak
I mean not using it
U make many instances of proprety
that not really a "memory leak"
: | , so my brain isn't braining anymore
But it does that
Really
Using prototype, make ur code more effecient and more optimized
memory leak is an object that exists but cant be accessed right?
a memory leak is when a function keep adding stuff without any control over it
how can a prototype prevent it?
That what google and chat gpt said : |
but only if you need to like add the exact same thing to a ton of objects?
oh yeah, forgor about that
anyway, thx y'all for the patience and for the brief lesson
So , when using prototype, it access that property
From the constuctor function
Instead of making new instances of it for each object
It called prototype chain
oh, I understand, it's similar to this
yeah, just hear me out tho
To make it easier for u
Let s say , we have one iphone chargeur
And all ur family has iphone
Without chargers
So instead of all ur family members buy new chargers
OH, Y'ALL SHARE IT
So buying new chargers is expensive
So the money in this situation is ur RAM
And u don't want to spend all ur RAM on new constant propreties that can be shared between all new instances of that object
Xd
I hope u understand that
Because it s too important concept
i can see its use but i think for an addon it's not pretty useful since a ton of stuff is already given, but similar to minato's isCrawling that's a way for it to be useful since it's gonna be used a lot
i need to catch up some sleep, in already tweakin
Kk
oh yeah, github
, goodnight anyways
"this" is getting no where
Learn what the "this" keyword does in JavaScript in 100 seconds. And stay tuned for a few minutes of more advanced discussion after the credits.
#javascript #100SecondsOfCode
Install the quiz app 🤓
iOS https://itunes.apple.com/us/app/fireship/id1462592372?mt=8
Android https://play.google.com/store/apps/details?id=io.fireship.quizapp
Upgrade...
can script stop game message?
like "Player has joined the game" or "Wolf was slained by zombie" type of message
no
Aww dang
use playerBreakBlock event and runCommand function
Can use JSON UI to hide said messages
Tutorial?
Don't have one
Besides maybe like https://wiki.bedrock.dev/json-ui/preserve-title-texts.html
import { Player, world } from "@minecraft/server";
world.afterEvents.entityHurt.subscribe(eventData => {
const player = eventData.damageSource.damagingEntity;
const entity = eventData.hurtEntity;
const equippable = player?.getComponent("equippable");
const slot = equippable.getEquipment('Mainhand');
if (player?.typeId == "minecraft:player", slot?.typeId === "ad:luminite") {
player.runCommand("say You hit an entity");
}
});
Anyone know why this doesnt work, it doesnt give any errors
use &&, not ,
What did they do to world.beforeEvents.playerInteractWithBlock.subscribe?
How to use it now?
it is the same
just not stable
Whats the newest manifest version?
Or in which version can I use it without having a syntax error
Latest NPM Types
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
Beta APIs NPM Types
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
Preview Latest NPM Types
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
Preview Beta APIs NPM Types
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
npm i @minecraft/[email protected]
1.12.0-beta
Ty
Wow, my way too big annoying pack which I didn’t update since 2023 finally works again
Tysm
Only problem is BlockAreaSize
it is blockVolume now
.getEntities({
excludeTypes: ["minecraft:villager", "minecraft:player"],
volume: new BlockAreaSize(1800, 400, 1800),
location: {
x: 1600,
y: -64,
z: 1600
}
}) ```
So I only have to change the name
Do I still have to import it or is it built in already?
no
how dose BlockAreaSize work
blockVolume need tow corners of the volume
uhhh
so like from -400, -400 to 400, 400?
How to do that if it isnt like blockareasize
vector3
new BlockVolume(from,to)
vector3 is with y, right?
so like new BlockVolume({x: -400, y: -64, z: -400}, {x: 400…?
Testing for entities in an area and executing somthing as them
ah turns out volume only need vector3
so this should work
.getEntities({
excludeTypes: ["minecraft:villager", "minecraft:player"],
volume: {x:1800, y:400, z:1800},
location: {
x: 1600,
y: -64,
z: 1600
}
}) ```
Oh lol
Alright
So they made it just simpler
Actually good change xD
Tysm for help <3
ur wlc
Entity.getComponent('item').itemStack
thanks
What tab is that?
Tab ?
VSC?
Vscode?
Yes
What u mean by tab
Its the documentation page
Sometimes you don't know the language or many don't know enough about computers.
I doubt it. I don't remember seeing that optional label.
Leave.
Not the official one
It called label not a tab
jayly docs
get entities options
world.afterEvents.itemUseOn.subscribe(eventData => {
const block = eventData.block;
const item = eventData.itemStack;
if (item?.typeId === "su:fish_net", block?.typeId === "water") {
player.runCommand("say you placed a block");
}
});
Anyone knows why this doesnt work
"Why this doesn't work" is not helpful.
Be specific and include relevant details about the question upfront.
- What are you trying to accomplish?
- If you have code, which part is not working? Any content logs?
- What have you already tried?
- Have you searched the Bedrock Wiki?
I would say, there is no way a block is called just "water"
And you can't really interact with water
sorry
Try getting the block from a raycast
it doesnt give errors or work in general
Agree
raycast?
You need the liquid clipped component for your item
still doesnt work either way
i tried
Replace , with &&
Great catch kiro
Maybe that's why it wasn't working for you because I've used lliquid clipped and it works
Thx
oh, ill try
dimension.getBlockFromRay()
i did, still nothing
im confused here
?
i should get the player from the evnentData and then use it to do....?
Just add a variable
Called player
let player = eventData.source
- change ur if statement
With this one :
Now everything is defined```js
world.afterEvents.itemUseOn.subscribe(({ source: player, block, itemStack: item }) => {
});
if ( item?.typeId === "su:fish_net" && block?.typeId === "minecraft:water" )
umm, isnt this what mine was like
ok
ok
Pretty certain that is optional. If "minecraft" is not there then it's applied automatically to the string.
Sure ?
Might be wrong, but I'm pretty certain.
better safe than sorry
And the type id
import { world } from '@minecraft/server';
world.afterEvents.itemUseOn.subscribe(({ block, itemStack: item, source: player }) => {
if (item?.typeId === "su:fish_net" && block?.typeId === "water" && player) {
player.runCommand("say you placed a block");
}
});
Will start with the Minecraft:
No
It s not automatical
U must add minecraft at first
import { world } from '@minecraft/server';
world.afterEvents.itemUseOn.subscribe(({ block, itemStack: item, source: player }) => {
if (item?.typeId === "su:fish_net" && block?.typeId === "minecraft:water" && player) {
player.runCommand("say you placed a block");
}
});
world.afterEvents.itemUseOn.subscribe(({ source: player, itemStack: item }) => {
const ray = player.dimension.getBlockFromRay(player.getHeadLocation(), player.getViewDirection(), {
includeLiquidBlocks: true,
includePassableBlocks: true,
maxDistance: 6
});
if (!ray) return;
if (item?.typeId === "su:fish_net" && ray.block?.typeId === "minecraft:water") {
// Your code
}
});
Bro is surely confused rn 💀
Fr
Any one ?
world.afterEvents.itemUseOn.subscribe(eventData => {
const block = eventData.block;
const item = eventData.itemStack;
const player = eventData.source
if (item?.typeId === "su:fish_net" && block?.typeId === "minecraft:water") {
player.runCommand("say you placed a block");
}
});
Wich one
it didnt run the command
Try this one
herobrine already told you && not ,
there no , in the thing, look at the updated one
Bro is still reading first message
none
Does Block.getTags() method work? I've always had problems with this method (with custom blocks) as it always returns only one tag.
Is Block supposed to have more than 1 tag ?
How u use it ?
I mean the way u implemented it in ur script
"format_version": "1.20.80",
"minecraft:item": {
"description": {
"identifier": "su:fish_net",
"menu_category": {
"category": "items"
}
},
"components": {
"minecraft:icon": "su_fish_net",
"minecraft:max_stack_size": 16,
"minecraft:liquid_clipped": {
"value": true
}
}
}
}```
there is component that allow your item to interact with blocks
yo should add it
idk it name
isnt on_use getting depriciated
there is none specifically for blocks
only block placer and entity placer
minecraft:on_use_on?
{
"format_version": "1.20.80",
"minecraft:item": {
"description": {
"identifier": "su:fish_net",
"menu_category": {
"category": "items"
}
},
"components": {
"minecraft:icon": "su_fish_net",
"minecraft:max_stack_size": 16,
"minecraft:liquid_clipped": {
"value": true
},
"minecraft:on_use_on": {
"event": "minecraft:item_use_on",
"target": "self"
}
}
}
}
You can get the event to fire with any item if you use the beforeEvent
isnt on_use getting removed
itemUseOn? no
Yes, I do use it
Try this
isnt on_use getting removed
🤷♂️ i do too
don't work with sticks and work with brush
Yes. The idea is to have multiple tags, but for some reason for the script the block only has one tag (even Block.hasTag doesn't work)
For example:
/**
*
* @param {Block|ItemStack|Entity} source
* @param {string} key
*/
export function getTagData(source, key) {
console.warn(source.getTags())
console.warn(source.hasTag("test"))
for (let tag of source.getTags())
if (tag.startsWith(key + ":")) return tag.replace(key + ":", "");
return undefined;
}
Block components (shortened):
"components": {
"tag:test": {},
"tag:gravel": {}
}
getTagData searches the tags for a match and returns the rest of it. But with the example block, getTags() only returns "gravel" and the hasTag returns false
If it didn't work then lower ghe format_version
Looks like you might be correct. The typeId for Items doesn't require it, but it looks to be necessary for blocks.
The namespace for items is assumed to be "minecraft" by default in the documentation unless otherwise specified.
:/ i dont want to use HCF tho, since its getting removed
?
not true
=== is for type check
I'm not referring to strict type matching. I'm speaking about the return for items.typeId in general. Since they are using a custom namespace it's necessary to pass it. Otherwise, they could leave it out and the return on that item would be the same result.
I mean when u use
Or
[Item][error]-minecraft:on_use_on has been deprecated and is not available in json format 1.20.70
Dang it
soo... any thing i can do
Yo who can make me an add-on for $5
I already told he was Pokémon anything that you can do that would revolve around Pokemon will do
Hmm
So what can you do that would be helpful for the Pokemon Mod
So Pokémon add-on
Yes
Including models , animation, etc... ?
Can I see some of your models
I don't make models ._.
I think this nor the place for that
Go to the skill share server and ask for a developer
Let's move into DM's
I don't think fiverr has add-ons creator , so
Yeah but it s better to do that anyways
I used to make packs for people on fiverr all the time
Cool
Jayly?... Oh.
You already solved?
Have you already resolved?
The Tags are no longer placed like this.
That's how block tags are formatted
only items have "minecraft:tags" component
And biomes
ye
With what we meet again, father. -_-

Can we use script to play attachable animation?
how do you decrement a stack?
yknow, - 1 instead of adding +1 to the stack? i ask this because when attempting to do -1 to .amount it gets an error saying it must between 1-255. so is subtracting literally impossible
if (stack.amount > 1) stack.amount--;
else stack = undefined;
using -- does nothing for me
not even an error
const chestInventory = blockAbove.getComponent("minecraft:inventory").container;
const itemInFirstSlot = chestInventory.getItem(0);
itemInFirstSlot.amount--;
ive tried different variations too,
itemInFirstSlot.amount--
itemInFirstSlot.amount - 1
itemInFirstSlot.amount = itemInFirstSlot.amount - 1
nothing
it better not be because i did const instead of let
when you get the item from a container the game clone it
meaning any change wont apply to the original item directly
you need to set the item to that slot
how would i do that?
chestInventory.setItem(itemInFirstSlot ,0);
after the change made
Can Minecraft net be used from Android?
if (itemInFirstSlot.typeId === blockBehindW.typeId && block.permutation.getState("minecraft:cardinal_direction") === "west" && northblock.typeId === "rel:steam_engine_powered" && northblock.permutation.getState("minecraft:cardinal_direction") === "north" && southblock.typeId === "rel:steam_engine_powered" && southblock.permutation.getState("minecraft:cardinal_direction") === "south")
{
itemInFirstSlot.amount = itemInFirstSlot.amount--;
chestInventory.setItem(itemInFirstSlot ,0);
if (blockInFrontW) {
block.dimension.getBlock(blockInFrontLocationWest).setType(blockBehindW.typeId);
}
}
its still not working and setting the item managed to break the other if statement.
what the error you are getting
im not getting an error, nothing is happening
and i know that first if statement is being activated and doing fine
so i restarted minecraft and now im getting an error?? weird?
75 is
chestInventory.setItem(itemInFirstSlot ,0);
try
chestInventory.setItem(0,itemInFirstSlot);
Okay no error
but nothing happens
tried restarting the game too
instead of
itemInFirstSlot.amount = itemInFirstSlot.amount--
im just going to try
itemInFirstSlot.amount--
Is chatSend cancellable in Stable APIs?
chatSend it self is not stable
oh my god it worked
good
im gonna cry
🗿
Oh, alright
you helped me reduced my code that had 2200 lines down to now 133 lines
i use to use setItem, so if the stack was 62, id setItem to 61, if it was 61 id setItem to 60. so i did that 64 times, times another 8 times , now i can just use subtraction
and every setItem i did was 4 lines long
bruh
hi everyone me again 😂 so i noticed beforeEvents.itemUse doesnt work on my item thats in the offhand, is there a way to get it to work for offhand items or no?
is it possible to make blocks that use "minecraft:custom_components" stop acting like they have interactable component?
anyone has the query parser ?
whar
@a[...]
"acting like they have intractable component"?
you can right click them and the hand swings
even tho i have nothing interact related in their code
whats in your custom component
the block json
i don't see why it would be intractable
you mean selectors parser?
ye
i think i do
but idk if this is what are you looking for
used it in an old world to clear entities
function parseSelectors(command) {
const selectorVariablePattern = /@([aeprs]|initiator)/;
const selectorArgumentsPattern = /\[([^\]]+)\]/;
let result = {
target: null,
arguments: {}
};
const variableMatch = command.match(selectorVariablePattern);
if (variableMatch) result.target = variableMatch[1];
else return result;
const argumentsMatch = command.match(selectorArgumentsPattern);
if (argumentsMatch) {
const argumentsString = argumentsMatch[1];
const argumentsArray = argumentsString.split(',');
argumentsArray.forEach(arg => {
const [key, value] = arg.split('=');
result.arguments[key.trim()] = value.trim();
});
}
return result;
}
it doesn't check if the arguments are valid
it should map to script query tho
yeah
i didn't count for complex arguments like hasItem
? i mean to say EntityQueryOption
oh
yeah that is better then what i have
What's the native way to give someone an item?
getting inventory component, adding new ItemStack and then addItem
thats what i did at least
!
Player.getComponent("container").container.addItem(itemStack: ItemStack);
the onTick custom component wont activate unless you place the block yourself?
I have a generated block and its not ticking unless I place it
this is lame
3D model that you "attach" to items to make them render 3D in third person camera
randomTick will do for now ig
❌
bro wtf it is correct
world.afterEvents.entitySpawn.subscribe((ev) =>{
let item = ev.entity
if(item.typeId !== "minecraft:item") return
const itemStack = item.getComponent("item").itemStack
item.nameTag = `§5${itemStack.amount}x§d ${getEntitysItemName(item)}`;
});
does anyone know how to update the amount?
lol
Can't; item component for entities is read-only
const itemStack = new ItemStack("minecraft:diamond")
player.getComponent("inventory").container.addItem(itemStack);
other people have done it, for when the item stacks the amount shows?
well yeah, but you can't edit the item once it is dropped in the world
how can i edit when they stack?
Good question
Maybe you can drop another right there too
i just gave him a documentation snippet xd
It sayd its at 99999
world.afterEvents.itemUseOn.subscribe(eventData => {
const block = eventData.block;
const item = eventData.itemStack;
const player = eventData.source
if (item?.typeId === "su:fish_net" && block?.typeId === "minecraft:water") {
player.runCommand("say you placed a block");
}
});
i want to make an item place a block, when placed on water
does this look good
beacuse it doesnt work
also the player.runCommand is just a placeholder
does the item have the liquid clipped component?
Like I told you yesterday?
yes
"value": true
}```
unless the player interact with block event detects it, idk
wdym
There's world.afterEvents.playerInteractWithBlock in beta versions of @minecraft/server that might trigger
Do you guys have any good idea on storing info to create a large database? I was thinking of using dynamicProperties or tags.
if it's one or the other, def properties
As minato said , databases are just lot of dynamic propreties
How many can be used tho?
like?
How many XD
Like 100? On one entity anyway.
Databases uses world instead of entities
Use DynamicPropreties
Because they are not limited
Wait really? That's great! I thought they were. Thanks!
They are limited, by 32767 characters
But u can divide them into chunks
By adding numbers to that dynamic proprety id
And that will make then unlimited
And if u can get them too, by for loop
You can have as many keys as possible combinations of 32k bytes.
Alright then. Thanks!
you sure? combinations exists
Yeah , i used it
Tho another question about usuing dynamic properties is retrieving names. Since stringifying the name with other info is hard to retrieve due to which characters/ letters the name might have.
U can make a json file
I mean u can make object of names
Then stringify it using JSON.stringify
Or stingified array
So turn the string into an object?
Can you show me a small example? I don't think I've delt into this side of JS yet lol.
Yes ofx
Any side exactly?
how can i define an entities current health and max health?
Oh! Yes. And no prob. Thanks for clarifying lol.
- just a note :
Set object is just like an array, but the special thing about it , u can duplicate an element in it twice as example :
U can do that with array :[ "Jam" , "Jam" , "kim" ]
With set object :
// Jam only appears once
[ "Jam" , "kim" ]
- it s not exactly an array , u can search for an item by index ( i just gave u an example to clarify what set is )
So like a Map()?
Not exactly
It just an object that make an element never be added more than once
- yeah it supports types unlike objects
So I can create a Set. Then Stringify it?
Yes
import { world } from '@minecraft/server';
// Step 1: Create a Set and add names to it
const Names = new Set();
Names.add("Steve");
Names.add("Alex");
Names.add("Herobrine");
let playersNames = JSON.stingify(Array.from(Names))
world.setDynamicProprety("id" ,playersNames)
Interesting. How do I unstringify it after that?
JSON.parse()
//step 2 : getDP and put it again in the set
const Names = new Set (JSON.parse(world.getDynamicProprety("id")))
Thanks!
Uw
Just experimented a little with what you told me and WOW. That is powerful.
What is powerful exactly XD ?
Changing values into string and converting them back into their original values. I never knew that was possible lol.
LOL
I believe in bibble
;-;
can anyone help, im trying to get my item to place a block using scripts
and so far what ive done aint working
how to detect when player get hit? like when player get hit that player will run command
entityHurt event
and why not block placer component?
scriptevent wry:func console.log("Hello World!")
[2024-07-28 09:50:25:294 INFO] Script event wry:func has been sent
[2024-07-28 09:50:25:294 ERROR] [Scripting] ReferenceError: 'eval' is not defined
add the object capabilities to the manifest
how do i do that good sir
{
"format_version": 2,
"metadata": {
"authors": [
"Me"
],
"generated_with": {
"bridge": [
"2.7.24"
],
"dash": [
"github:bridge-core/dash-compiler#8fa35c73292f6382747d0f411fca26431a6d2c8e"
]
}
},
"header": {
"name": "",
"description": "",
"min_engine_version": [
1,
21,
0
],
"uuid": " _some code_ ",
"version": [
1,
0,
0
]
},
"modules": [
// modules
],
"capabilities": [
- "script_eval"
],
"dependencies": [
//modules
]
}
thank you!
Hello.
-_- script eval? Where in the documentation does it mention that?
Can someone explain to me the difference between "item" events? Is it true that you cannot detect a click on the screen or at least one block?
microsoft docs i think
Please re-read my question and answer again.
That's a lie. Your beliefs are not part of reality.
XD
you have custom components, you can detect when a player right click on an item
or on a block
Custom components? I had not thought of it. I will review what is granted in addition to what we already have.
They haven't documented that in mslearn, but here's some infomation about it https://jaylydev.github.io/scriptapi-docs/features/script-eval.html
I'll see.
A framework?
guys how can I get player coordinate and store it like you can /back to your previous postion before teleporting to other location or before die
nvm seems its too complex for me as a beginner
idk why this isn't working and since i dont really have time to wait for 20 minutes what i did is set it to night and sleep the "show days played" seem to change to day 1 but the script still isn't running
function day() {
if (!world?.getDynamicProperty("day")) {
return 10;
}else return world?.getDynamicProperty("day");
}
if (world.getDay() >= day() && !world?.getDynamicProperty("day")) {
world.setDynamicProperty("start", true)
}```
i know it says 10 there but i adjusted it to run on day 1 using the day dynamic property
When is this snippet running? And where you setting the "day" dynamic property?
Your logic could be changed some to show your intent better too—your negation ! will cast the result of getDynamicProperty to a boolean, so while a value of undefined will trigger it, so will 0. Better to compare it explicitly, like world.getDynamicProperty("day") == undefined.
it's running on an interval, i set the day using a modalform
the modal form works fine since it tells me the value after the enter it
it still didn't work for some reason, there isn't an error aswell
player.setDynamicProperty("save_location", player.location);
replace set with getto get
and you should also save the dimension as well
cuz i need it to place block on water
const replaceBlocks = [
'minecraft:air',
'minecraft:water',
'minecraft:lava',
]
world.afterEvents.itemUse.subscribe((event) => {
const {source, itemStack} = event
if(itemStack.typeId !== 'item:id') return
const blockInView = source.getBlockFromViewDirection({maxDistance:4.5})
if(!blockInView) return
const {block: blc, face} = blockInView
const block = getAdjacentBlock(face,blc)
if(!replaceBlocks.includes(block.typeId)) return
block.setType('block:id')
//use setPermutation if you want specific properties
if(block.typeId == 'minecraft:water') block.isWaterlogged = true
})
function getAdjacentBlock(face,block) {
switch(face){
case"Down" : return block.below();
case"Up" : return block.above();
case"East" : return block.west();
case"North": return block.south();
case"South": return block.north();
case"West" : return block.east();
}
}
@misty pivot because there are SyntaxErrors
lemme check real quick
oh
Returns number - The current day, determined by the world time divided by the number of ticks per day. New worlds start at day 0.
for Ticks use system.currentTick
so that means sleeping doesn't count as a day?
function day() {
if (!world?.getDynamicProperty("day")) {
return 10;
} else return world?.getDynamicProperty("day");
if (world.getDay() >= day() && !world?.getDynamicProperty("day")) {
world.setDynamicProperty("start", true)
}```
why do you need to store that
i know
i meant why 10
oh, it's a test basically
What u wanna do with the second if statement?
Yeah i see the problem now
Rhe second if statement will never work
the second if statement basically if it's pass the day property/default day then it will start an event or in this case make a property named start
you are not setting the day to the dp
i tested both with and without a day dp set, both didn't really start the event
function day() {
if (world.getDay() >= day() && !world?.getDynamicProperty("day")) world.setDynamicProperty("start", true)
if (!world?.getDynamicProperty("day")) {
return 10;
} else return world?.getDynamicProperty("day");
}```
ah so place the whole if statement in the function
Yes
but why wouldn't it run the first place earlier?
Because
The first if statement
The includes return
Block the the second if statement
So the code after return will never work
oh return is like a break
Yes
Uw
hm, what's strange is it didn't work still, and i tested yes what's being shown in "show days played" option in game is the same value as world.getDay()
how about i try a ternary operator?
can you tell what are you trying to do?
maybe like
if (world.getDay() >= world?.getDynamicProperty("day") != undefined ? world?.getDynamicProperty("day") : 10) {
world.setDynamicProperty("start", true)
}```
kinda like this
Wth
What did u did
@misty pivot what are u trying to do first ?
so i used the ternary operator to see if day is defined, if so it will use value of they else it'll use default of 10
yes
U just make the code bigger for no reason
Did it work now ,?
well i didn't test yet but i'll try right now
nope it didn't
Ur logic is kinda bad
...
Tell me what u wanna do
Or send me full script
well that is basically the whole script, i just put that into a system.runInterval
What about the imports ?
Show me
oh yeah, i did import world and system
this is the first iteration
import { world, system } "@minecraft/server";
const runner = system.runInterval(() => {
function day() {
if (world?.getDynamicProperty("day") == undefined) {
return 10;
}else return world?.getDynamicProperty("day");
}
if (world.getDay() >= Number(day()) && !world?.getDynamicProperty("start")) {
world.setDynamicProperty("start", true)
}
})```
import { world, system } from "@minecraft/server";
const runner = system.runInterval(() => {
const dayValue = world.getDynamicProperty("day") || 10;
if (world.getDay() >= Number(dayValue) && !world.getDynamicProperty("start")) {
world.setDynamicProperty("start", true);
console.warn("Dynamic Property, start, has been set to true.");
}
});
import { world, system } "@minecraft/server";
const runner = system.runInterval(() => {
function day() {
if (world.getDay() >= day() && (!world?.getDynamicProperty("day"))) world.setDynamicProperty("start", true)
if (!world?.getDynamicProperty("day")) {
return 10;
} else return world?.getDynamicProperty("day");
}
world.sendMessage(`day : ${day()}`)
console.log(day())
},1)```
@misty pivot
i'll try it out
ah, it's a function right, it's declared but not used earlier
Yes
Just eliminate the function. Doesn't appear to be necessary.
- u need to set the dynamic proprety also
Agree
Why does player.selectedSlot not return a valid number anymore and how to fix it?
get
player.selectedSlotIndex
this is confusing
// List of block types that will be replaced when interacted with
const replaceBlocks = [
'minecraft:air',
'minecraft:water',
'minecraft:lava',
]
// Subscribe to the 'itemUse' event that occurs after item usage in the world
world.afterEvents.itemUse.subscribe((event) => {
const { source, itemStack } = event;
// Check if the item used matches a specific item ID
if (itemStack.typeId !== 'item:id') return;
// Get the block directly in front of the player's view within a maximum distance of 4.5 blocks
const blockInView = source.getBlockFromViewDirection({ maxDistance: 4.5 });
if (!blockInView) return;
// Destructure the block and its facing direction ('face')
const { block: blc, face } = blockInView;
// Get the adjacent block based on the face direction
const block = getAdjacentBlock(face, blc);
if (!replaceBlocks.includes(block.typeId)) return;
// Replace the current block with a new block type
block.setType('block:id');
// Set specific properties for certain block types
if (block.typeId == 'minecraft:water') {
block.isWaterlogged = true;
}
});
// Function to get the adjacent block based on the given face direction
function getAdjacentBlock(face, block) {
switch (face) {
case "Down": return block.below(); // Below the current block
case "Up": return block.above(); // Above the current block
case "East": return block.west(); // West of the current block (facing East)
case "North": return block.south(); // South of the current block (facing North)
case "South": return block.north(); // North of the current block (facing South)
case "West": return block.east(); // East of the current block (facing West)
}
}
Added comments to explain what the code does as you read along from top to bottom. Should clear it up some.
thanks so much
been trying to figure it out
also, why does it need to check adjacent blocks @distant tulip
A question for Minato.
for (const entity of world.getEntities()) it responds with "not a function" what is the problem?
Ty
Because world dosen't has getEntities
As function
can js apply component_group?
Is there no way to read files in the script?
when you encounter a problem like this, it would help to look at the class again and see what methods are available. Perhaps dive into some of the methods to find which one has getEntities.... though in this case it is not obvious... use getDimension() to get to Dimension Class https://jaylydev.github.io/scriptapi-docs/latest/classes/_minecraft_server_1_12_0_beta.World.html
@hazy nebula
const allDimensions = [ 'overworld', 'nether', 'the_end' ];
const dimensions = allDimensions.map(dimension => world.getDimension(dimension));
const entities = dimensions.flatMap(dimension => dimension.getEntities());
for(const entity of entities) {
//code
}
Nice illustration lol.
thanks lol
Thask everyone but i had change for (const entity of world.getEntities()) to const entity = world.getEntities()) and it work!
Ahhhh
Hhh
💀
We told u world.getEntities()
Dosen't exist
In what world does that work
no, I just took it out of the loop and it actually worked
So did you actually pick up any entities.... can you do a loop on them and sendMessage and prove it
just a simple (from your code) entity.forEach(e => world.sendMessage(${e.typeId})) and a screenshot
Like that
Ok can u hover ur cursor
On getEntities
And u will see it has no description
It will show u
(any)
Only
world.getEntity()
Is typings installed on their pc
Exist
Good question ☠️
he is mistaken, he used dimension....
Oh
I see
LOL.. that was funny.. the scripters defense brigade
scripters questioning their knowledge
This is how inner universes collapse, programmer breathe logic...
possible to get collision box?
No
No
xd
There is no clearer answer than that.
And how do you verify that it is the hitbox of the entity?
What I do is make a predefined hitbox in the code in those situations
with an average size
Simply create a map of ids to hitbox
Yes
If u know how to deal with node js
U can make everything automated
And make it get the hit box of ab entity
And put it in object which :
{entityid : hitboxValue
}
hi there, what is the limit for saving dynamic properties? if there is any that I should concern about? or how do I set the threshold? [Scripting] 13.83 MB of dynamic properties were saved during the last minute, exceeding the 10 MB threshold.
No limit
The only limit is ur device's storage
Agree
.
i wanted to update my old anticheat, but i see that horion doesnt have a nuker anymore did they delete it or is something corrupted? ||wrong forum||
my brain... i can't.... figure it out.... what is the RegEx for a string with no alpha a-z
anything that isn't a letter?
ues
^[^a-zA-Z]*$?
❤️🩹
guys can anyone help me ?
With?
Did you search in #1067535382285135923 in case someoen else had the same quetsion? We get this a lot as far as I know
none of them exactly fit my question :(
You gotta work out that logic yourself or discord search to see if someone added one to resources (probably not)
i want it so that players can execute a command lime /function bounty and a menu pops up prompting them to select the person and the amount
there isn't anything similar to it
so that is Chat Commands and JsonUI
I could, but then I'd have to learn Json UI forms.... (plenty do them on here, so find one) and I am not going to teach. I have a feeling you are not familiar with scripting
im a little bit familiar
Well good time to get deeper into it. Figure out how to make a simple script to say something every 5 minutes or tell a player when he hits another player and you are halfway there.... chat commands are easy
ill try thanks for the help :)
Visual Studio Code: The epicenter of your Minecraft modding journey. Download it here:
🚀 Visual Studio Code Download: https://code.visualstudio.com/download
GUI Template. Grab it here:
📄 GUI Template Download: https://www.mediafire.com/file/gnkd5t5g7s3345i/GUI_template.js/file
But remember, GameTest Framework is an experimental playground with...
This one firsthttps://www.youtube.com/playlist?list=PLFJcX9i957loAeMhm1ZqgqyVSiLqYmw-7
more on youtube
thanks :)
cool whan are you sharing it :0
Can someone send me the link to the sample packs? Idk how to get it or just tell me

