#Script API General
1 messages · Page 50 of 1
I tried to do this with a diamond sword but it didn't work
show code
I don't understand what you want to say
I want to say that this is not possible to read
formatted
What error does the debugger display?
It doesn't give any error but it doesn't work
there is no error from what i can see
So you didn't set the item back to inventory
that function is not even triggering
This is what happened a short time ago
Which
const items = inventory.container.getItem(pslot);
It works when I make it a player but it doesn't work when I make it an item
import * as mc from "@minecraft/server";
let Powers = {
"dragon_ball": {
animation1: "playanimation @s animation.dragon_ball wesl3y",
sound1: "playsound dragon_ball @a ~~~ 1.5",
shoot1: ["wesl3y:jutsu_projetil", "dragon_ball", "player.name"]
}
}
mc.system.runInterval(() => {
for (const player of mc.world.getPlayers()) {
if (player.hasTag("test3")) {
usePower(player, "dragon_ball");
player.removeTag("test3")
}
}
});
function usePower(player, powerId) {
const test = Powers[powerId];
if (test.shoot1 != null) shootPower(player, test.shoot1[0], test.shoot1[1], test.shoot1[2]);
}
function shootPower(player, id, event, name) {
player.runCommandAsync(`say ${player} ${id} ${event} ${name}`);
}
[Scripting][error]-Unhandled promise rejection: CommandError: Erro de sintaxe: "[": inesperado em "say »[«object Obj"
help
player -> player.name
does data.cancel no longer cancel a fishing rod?
i recommend using https://discord.com/channels/523663022053392405/1252014916496527380
your code kinda work but you are losing the items data that way
Hmm
I couldn't figure out how to combine this with my own code.
What means error:
Lexical declarations cannot appear in single-statement context?
Lexical declarations are when you use let or const to declare a variable.
The error stems from when you try to do this inside a single statement.
Example of single statement:
if (true) let x = 1;
Correct way:
if (true) {
let x = 1;
}
Just remember that x is only available within the scope of that block statement. So if you need access to it outside of that block statement then declare it first.
is there any way to get an itemStack instance of a placed shulker box that keeps the stored items?
block.getItemStack(
1, // Amount
true // With Data
)
and if i want to get the item in the second slot of the shulkerbox?
you cannot access the inventory when its not placed
ik
const secondSlot = block.getComponent('inventory').container.getItem(1)
and with getItemStack
you could do getSlot(1).getItem() but I edited it to be just getItem(1) because that might be better.
here's a doc for the block inventory component.
Documentation for @minecraft/server
?
both of these sites are like the same.
Waveplayz example is in there
ah.
Okay need some thoughts,
I changed my spawner system to no longer spawn entities but instead just adds loot and xp inside the herobrine chestformdata setup i have.
Now... the calculations are based off events/datenow, so NO system.runInterval at all.
Is running events by 30 people constantly horrible? I forget is there a way to keep the event from being ran per player.
Because they can punch to generate loot
Or wait slowly over time with datenow
Calculations
why not use block ticking component
Well, i want to not have any ticking at all
Even for blocks
Just event based only
It's based off of donutsmp spawnwrs but heavily modified for better efficency
Just different type of gameplay for the most place
Wasn't there something in js that would help merge events for players? One sec let me look at some old code
Sorry just going brain dead rn, ignore everything
ok
Is there a good way to replicate mending? I'm giving players xp directly but don't think it would add to a weapon they are holding upon collection. As it's command xp
Since they are not killing entities, the mending wouldn't work normally
As I just give it to the player
So I need to recreate the mending enchant
Just the .damage right?
Can't say I've ever tried to recreate it
Oh ok haha
I can just want sure if ypu had any thoughts on that
I'm not sure what amount
Is given to the mending enchant on a sword. Like what fix amount
It's probably on the wiki
1 xp for 10 damage etc
I'll check ty
This logic helps 10p% thx
100%
Its 2 durability per 1 xp.
how do I create an event listener with server-net?
does it go on world, server, or some other superclass for it
with the new packetSend and packetRecieve
That's for checking what packets from bedrock protocol BDS sent/receive. it's used like this i think https://jaylydev.github.io/scriptapi-docs/latest/classes/_minecraft_server-net.NetworkBeforeEvents.html
How do you detect if it is daytime?
Description
There are two functions in this script:
- function
GetWorldTime
returns
The hours and minutes of the world time.
example
getworldtime.js
import { world } from "@minecraft/server";
const { hours, minutes } = GetWorldTime();
world.sendMessage(`The time is ${hours}:${minutes}`);
- function
getTimeOfDay
Gets the name of the time of day
returns
'Sunrise', 'Day', 'Noon', 'Sunset', 'Night', or 'Midnight'
Credits
These scripts were written by Jayly#1397 on Ja
It's already labeled.
Just do js const time = world.getTimeOfDay(); if (time >= 1000 && time <= 6000) {}
-# oof nvm someone sends an function already lmfao
Thanks
could someone help me update a old pack?
[Scripting][warning]-Debugger auto-attach waiting for [0] seconds.
[Scripting][warning]-Debugger auto-attach did not connect.
[Scripting][warning]-Debugger auto-attach waiting for [0] seconds.
[Scripting][warning]-Debugger auto-attach did not connect.
[Item][error]-key:use | run_command | child 'run_command' not valid here.
[Item][error]-blackey:use | run_command | child 'run_command' not valid here.
[Actor][error]-New World | actor_definitions | C:/Users/treev/AppData/Local/Packages/Microsoft.MinecraftUWP_8wekyb3d8bbwe/LocalState/games/com.mojang/development_behavior_packs/Crate System [BP] | crates:craterare | minecraft:entity | events | hit | run_command | child 'run_command' not valid here.
[Actor][error]-New World | actor_definitions | C:/Users/treev/AppData/Local/Packages/Microsoft.MinecraftUWP_8wekyb3d8bbwe/LocalState/games/com.mojang/development_behavior_packs/Crate System [BP] | crates:cratelegendary | minecraft:entity | events | hit | run_command | child 'run_command' not valid here.
[Actor][error]-New World | actor_definitions | C:/Users/treev/AppData/Local/Packages/Microsoft.MinecraftUWP_8wekyb3d8bbwe/LocalState/games/com.mojang/development_behavior_packs/Crate System [BP] | crates:cratecommon | minecraft:entity | events | hit | run_command | child 'run_command' not valid here.
[Scripting][warning]-Plugins have been loaded successfully in 0MS
its run_command but what methods are there?
ok first of all this is not a script API problem second of all use queue_command third of all if you want API Version use Entity.runCommand()
function checkForArmor(player: Player, armor: ItemStack | undefined) {
const netheriteArmor = "minecraft:netherite_chestplate";
if ((armor?.typeId === netheriteArmor) && player.isSneaking) {
player.addEffect("invisibility", 200, { amplifier: 1 });
world.getDimension('overworld').runCommandAsync(`invisibility`);
}
}
function everyTick() {
const players = world.getAllPlayers();
for (const player of players) {
const equipment = player.getComponent("equippable");
const chestArmor = equipment?.getEquipment(EquipmentSlot.Chest);
checkForArmor(player, chestArmor);
}
}
system.runInterval(() => {
everyTick()
}, 0)
got an error message
Property 'getEquipment' does not exist on type 'EntityComponent'.ts(2339)
any idea why this doesn't work?
You need to cast it.
player.getComponent("equippable") as EntityEquippableComponent;
thank you so much!it's working now
Description
A function to get player's clicks in a second
Credits
These scripts were written by Jayly
Description
This script checks whether a player has the hack "Nuker" enabled through the use of block break event.
Credits
These scripts were written by iBlqzed
using @minecraft-server-net module how can i check a packet size & packet name and then cancel it??
Then look at the packets and use those...
Packet id
They have a link
Ypu can see who is sending the packet and cancel it depending on the player
Description
A simple to use command creator.
Parameters:
info(Object): An object containing the information about the command.name(string): The name of the command.description(string): The description of the command.is_staff(boolean, default: false): Indicates if the command requires staff privileges.
Example usage
commandBuild.create(
{
name: 'getCommands',
description: 'Get a list of all commands registered',
is_staff: fa
```...
so i can make a system that ban all player that send a certain packet?
Probably, i haven't done much with them but yeah. It tells you what 3 things it can do in the before event. So you have to basically do what you can since it's limited to just canceling.
oh okay
I'm trying to replicate the red and green light system from the squid game, however, there seems to be a bit of a delay since even if the player stops, it still detects if they moved.
Hint: we can't read minds, so it would be nice if you could show us the code.
system.runInterval(() => {
world.getAllPlayers().forEach(player => {
const isMoving = player.getVelocity().x !== 0 || player.getVelocity().y !== 0 || player.getVelocity().z !== 0;
if (isMoving && red == true) {
player.sendMessage(`${player.name} is Moving`);
player.runCommandAsync('kill @s')
}
});
});
Can you use the beta API?
If so, you can try this
same result
Then just set a delay
delay the velocity check after the red light message
- players will have time to react
@celest abyss
even a 10 tick delay still capture a small velocity
so maybe check for bellow 0.01
Ty
Had anyone used server net http requests at all? Does it work on worlds/realms along side a server?
It sure don't
Awh ok
Solely works on BDS
if you want to implement something locally you might wanna look into wsserver
So my current plot system works on
*Remove player money
*Adds tag
*Deletes the command blocks```
But i'd also like to make an upgrade and make it to an addon so it whould have a better system
Ok!
is block ticking component laggy? if too many in an area?
i use coordinates/locaiton of a block to link it to a database... so it wouldn't be compatible with a plot system
It’s extremely efficient and fast
hmm ok, what about storing data onto a block itself so if it gets pushed by a piston it still has the data regardless of location
Block permutations/states would work for that
well i was hoping dynamic info
the issue is, i've used entities in the past
Ban pistons
lol
fair.... hmm
i guess the only way would be to move the location data to the pushed location
for pistons..
but
for plot ssystems that won't work... i would have to use some sorta sign
and store data onto a sign constantly
i wish we could save data like a sign
SaltySean yearns for block dynamic properties as well
yeah that would be legendary
thats just what i need lol
i use itemDynamicProperties to store data between picking up and placing down...
and sorta use the lore as well
i mostly use lore for stackable reasons...
Yeah
i've just been working on this mostly
and thats when blockDynamicProperties would be amazing
i use the instant form refresh so you don't see the animation which is nice.
in resource
Nice
i've debated using without the inventory part, as its just unusable... but alot of other addons use the inventory still lol
so it would be more compatible keeping it
so idk, the compatibility thing is so annoying... but i guess it wouldn't matter for someone that knows json ui somewhat to subtract forms as needed
Huh, does set fluid colour for water apply some sort of math transformation due to the tint?
.fluidColor = {alpha: 255,red: 255,green: 255,blue: 255}
Returns: {alpha: 1,red: 1,green: 1,blue: 0.00392...}
Resolved. See the OSS server: #879773489601585244 message
world.afterEvents.playerJoin.subscribe((eventData) => {
const joiner = eventData.playerName
system.runTimeout(() => {
joiner.sendMessage(`§eWelcome, your rank is Default. Type :help for a list of commands.`);
}, 10);
}
)
i know what is wrong but im not sure the best way to go about fixing it. how should i get the entity of the player joining just off their name?
use playerSpawn not playerJoin
will that ensure they're fully loaded in too?
I don’t get why they do… it’s legitimately useless lol
Probably just easier to acquire
yeah lol, i've decided to make my own beautiful design and they can suck it
gotta love how the rideable component just breaks the game.
just trying to make it when an entity spawns in, another entity spawns and rides the entity, but it just breaks the server and crashes the game.
what do you guys think the laggiest particle is
im thinking like huge_explosion_emitter?
onStepOn but two entities has to be at the same location for it to function
its creepy, i asked o1 ai to fix a dynamic form for herobrines template... to remove the inventory part...
and it did it perfectly...
i love the new update that makes them dynamic
a while back
Crazy, almost like it exists on the GitHub 😳
ai users realizing that AI is incapable of creating new original code, becuase thats not how AI works
😲
as an ai model maker, i vouch
lol, it wasn't that i was amazed it did something already done... iwas just suprised it got it right
lol true
function getScore(player, objective) {
try {
const score = world.scoreboard.getObjective(objective)
const scoreValue = score.getScore(player);
return scoreValue
} catch (error) {
return 0;
}
};
world.afterEvents.itemUse.subscribe(ev => {
if (ev.itemStack.typeId === 'minecraft:clock') {
shopMenu(ev.source)
}
})
const shopData = [
{
title: "SHOP MENU",
description: "Select the item you want to buy",
insufficientFundsMessage: "You don't have enough money",
purchaseSuccessMessage: "You purchased the item successfully",
scoreboardObjective: "tuscore"
}
];
const items = [
{
name: "Apple",
itemId: "minecraft:apple",
cost: 1,
quantity: 13
},
{
name: "Iron Ingot",
itemId: "minecraft:iron_ingot",
cost: 30,
quantity: 10
}
];
function shopMenu(player) {
const menu = new ActionFormData();
menu.title(shopData[0].title);
menu.body(shopData[0].description);
for (const item of items) {
menu.button(`${item.quantity} ${item.name} for $${item.cost}`);
}
menu.show(player).then(r => {
if (r.canceled) return;
const selectedItem = items[r.selection];
if (getScore(player, shopData[0].scoreboardObjective) >= selectedItem.cost) {
const inventory = player.getComponent('minecraft:inventory').container;
const itemStack = new ItemStack(selectedItem.itemId);
itemStack.amount = selectedItem.quantity;
inventory.addItem(itemStack);
const score = world.scoreboard.getObjective(shopData[0].scoreboardObjective)
score.setScore(player, getScore(player, shopData[0].scoreboardObjective) - selectedItem.cost);
player.sendMessage(shopData[0].purchaseSuccessMessage + '\n§6-' + selectedItem.cost);
} else {
player.sendMessage(shopData[0].insufficientFundsMessage);
}
})
};```
Does this look
Weird?
Can i have the link? I cant found it
Thx
Note that the inventory section of the form is simply for display, and does not reflect the actual player's inventory. Hopefully coming soon!
Soon when 😭

Just do the one without inventory for now
Description
This script checks whether a player has the hack "Nuker" enabled through the use of block break event.
Credits
These scripts were written by iBlqzed
how can i get fishing hook owner?
system.runInterval(() => {
for (const player of world.getPlayers()) {
const inventory = player.getComponent('minecraft:inventory').container;
inventory.addItem(
inventory.getItem(0)?.typeId === 'minecraft:compass'
? new ItemStack('air')
: new ItemStack('minecraft:compass', 1)
);
}
});
Can I make this non stackable?
you can check if the amount is greater than 1, and then set it back to 1.
but actually non-stackable, no.
Yeah i might just do that, thank you
Probably try using entitySpawn event, and then the ItemUse event and coordinate some sorta link between those two to get the owner
I would suggest either using recovery compasses or setting the item to have invisible lore of the current date
itemStack.setLore(["§" + Date.now().toString().split("").join("§")]);
That way you don't need to loop through it every tick, more efficient
I'll give that a try thank you!
If Date.now is too long and the lore will make the ui too big when you hover over it you can use system.currentTick alternatively, granted multiple players will not get compasses in the same tick
Actually well Date.now() doesn't make a difference since this has to be ran in an after event anyways
Description
A function to get player's clicks in a second
Credits
These scripts were written by Jayly
How to fix this block in creative inventory looks weird in mobile phone. But in PC it's fine.
change bones order
top bones render first
you can use websockets on worlds, not sure what can you actually do on Realms tbh
Is it possible to eliminate the event where the fish spawns from the fishing rod?
It's weird but in my PC it's fine
entitySpawn then .remove() the item entity by typeId
not fishing hook
The loot right?
It's an entity
It's hard coded, we can only remove the entity if it spawns.
You would spawn anything else you wanted and then teleport the new loot to the player
Yes the fish that comes from the loot when your fishing
So get rid of the loot from fishing?
u mean?
What are you tryn to achieve in the end
I just hope the fish doesn't come
Okay yes, then you use the entitySpawn event in scripts to remove the entity so you don't get fish anymore, you can define the entities you want removed because you can get the owner of the fishing hook etc.. by getting the entitySpawn info of the latest player to use the itemUse event.
Your tryn to replace the fish with a different item?
Or remove them all together
I think he wants to remove the event entirely
yea this
Try going to the loot table file and deleting every drop and see what happens
in fishing_hook.json?
No.
Well, i don't think there is a cancel before event for entitySpawn. I would have to check .... you might be able to remove all the loot tho in the json loot table
BP/loot_tables/gameplay/fishing
There we go, dude in for the W
I feel like the event will still trigger it just doesn't give you anything 😂
That's exactly what I was thinking
Best method i would think
What is he even trying to do
But I like the idea of using that event to my advantage, so I could replace the loot with somethig else.
I have no idea
I assume change out the fishing style?
yesss
Didn't he ask how to link fishing hooks to the player that used it as well
Yep
You can do that with like 10 lines of code 
Yep
You can also just edit the fishing_hook.json file and remove the minecraft:loot component if you want it to not drop anything
The fish bubbles still trigger no matter what but if you remove the loot its good enough I think
world.afterEvents.itemUse.subscribe(({ source: player, itemStack }) => {
const head = player.getHeadLocation();
const viewVector = player.getViewDirection();
if (itemStack.typeId === "minecraft:compass") {
const ammo = "minecraft:snowball";
const direction = { x: head.x + viewVector.x, y: head.y + viewVector.y, z: head.z + viewVector.z };
const power = { x: viewVector.x * 1.25, y: viewVector.y * 1.25, z: viewVector.z * 1.25 };
const entity = player.dimension.spawnEntity(ammo, direction);
if (entity) {
const projectileComp = entity.getComponent('minecraft:projectile') as any;
if (projectileComp) {
projectileComp.shoot(power, { owner: player });
}
}
}
});
guys how to do rapid fire?
I made a compass to shoot snowball but it only shoot once, How to make it so it'll shoot as long as I use it
Is there a way to run a script on an item when it’s created?
I’m trying to set a dynamic property once an item is made
@steady glade
import { world, system } from "@minecraft/server";
let use = {};
world.beforeEvents.itemUse.subscribe(({ itemStack, source }) => {
if (source.typeId !== 'minecraft:player') return;
if (itemStack.typeId === '<item>' && !use[source.id]) {
use[source.id] = true;
if (use[source.id]) {
const head = source.getHeadLocation();
const view = source.getViewDirection();
system.run(() => {
const bullet = source.dimension.spawnEntity('<projectile>', { x: head.x, y: head.y + 0.1, z: head.z });
const proj = bullet?.getComponent('projectile');
proj.owner = source;
proj.shoot({ x: view.x * 5, y: view.y * 5, z: view.z * 5 });
});
}
}
});
world.afterEvents.itemReleaseUse.subscribe(({ itemStack, source }) => {
if (source.typeId !== 'minecraft:player') return;
if (itemStack.typeId === '<item>' && use[source.id]) use[source.id] = false;
});
There are better ways but this is just as simple as possible....
you can try itemStartUse and itemStopUse
You can check the player inventory but i think it will be expensive
tho you need to make your item eatables
I mean for every x ticks
Yeah, that’s my thought. It’s not very good though. I’m already iterating over player inventory every two seconds, I guess I can do a little more during that
Thank you!
Instead you can check just main hand
Inventory will work best for what I am trying to do, but you’re right
Iterating over the inventory once every couple seconds isn’t that bad
I was hoping for something like beforeEvents.playerInventoryAdd
hopefully, even better if there's before events for entityHitEntity or entityHurt
Alright! How would I know it’s an item? Will the dynamic properties persist once it’s picked up?
const itemStack = Entity.getComponent('item').itemStack;
you can grab the name amount etc of the item as an entity.
tysm!!!
is this a solid tool to obfuscate scripts and make them harder for people to steal our code??
JavaScript Obfuscator is a free online tool that obfuscates your source code, preventing it from being stolen and used without permission.
yes and no.
yes for a person who don't know how to de obfuscate that or understanding coding at all
And no since it can be easily reverted
There is a event for item break?
No direct way
Whats The other way?
in playerBreakBlock, playerinteractwithBlock, and playerinteractwithEntity has two type of ItemStack, the before eit happens and after it happens
other than these event listeners yeah you definitely need to use runtInterval
world.afterEvents.playerBreakBlock.subscribe(({ itemStackBeforeBreak, itemStackAfterBreak }) => {
//...
});
world.beforeEvents.playerInteractWithBlock.subscribe(({ beforeItemStack, itemStack }) => {
//...
});
world.beforeEvents.playerInteractWithEntity.subscribe(({ beforeItemStack, itemStack }) => {
//...
});```
here.
if you're gonna ask about itemUse, nope you can't use the beforeEvents built-in ItemStack since there's bug idk if I can say bug that the amount, name everything that includes durab or enchantments, matches the afterEvents ItemStack.
Tho I'm not sure maybe it depends on the item but you need to use equippable or anything that can grab an ItemStack in the beforeEvents and compare to the afterEvents
^
Thx
Is there a better way to prevent this?
I have been working on a project i am passionate about, and have had my projects stolen, put on youtube gaining hundreds of thousands of views and im scared for it to happen again HAHHA
i don't think there's 100% full proof way but what I'm thinking is to make the variables hard to understand like instead of const itemStack it would be const I
Or some sort idk..
-# never released an addon in my life (scared to be insulted)
nope
my addon got stolen too, if it wasn't for deobfuscator tools i would have never known
when he released the addon i offered help sense i got experience in that kinda of addon, but later i used a deobfuscator and found his whole code based on mine
i lost motivation in that project and ended up discontinuing it
you only have 3 options, marketplace, open sourcing your addon, release it under copyright and hope for the best
damn. That hurts NGL 😭
as what Minato said, Marketplace, Open Sourcing or just Copyright it
didn't even share the part that hurt the most, lol
I was thinking the only way (not 100%) but you list the players nameTag who bought the addon and then give them a special code. So when they are in game, they have to type that code and login to that player account (nameTag)
What is it?
that can be easily bypassed. Especially those who are experienced enough
tbh using others code isn't bad it's learning but without consent? Yeah different story
It also depends on the situation you can't just judge them
Exactly, the people who resell is the sore thumb
fuckin hell you stole and sell it? Wtf
that's out of line
Huh?
oh nvm I misunderstood LMFAO
Oh lmao
Yeah haha, the eula, but the only way around that is probably subscription based stuff
So it's just player content. Not specifically addons
But obviously under the table sales all the time
That's a long typing man.
i sent a dm to a big youtuber asking for review and got ignored, after a long time i got a notification of a video about the stolen one from the same youtuber
No way....
That's insane
Ain't no fuckin way
Bro just yoinked it.
yes way, lol
without even saying a single word?? 😭
yeah
What addon was it
Bro literally said "You shared it? Thank you then imma own this then" 😭🤯
Yeah, I do love sharing free addons, but stuff like that is stupid.. can't even police it
Imagine stealing an addon and calling the police...
Lmao
"hello 911, this guy stole my add-on can you arrest him?"
I haven't ever done a wsserver? Is it possible to send a verification thing through that
That's why sometimes I don't accept being a tester and let someone become a tester.
That's fair
i cringe every time i see this now lol
unless it's on a server.
Nooo not that one!
ohh my fuckin god that one
YESS. I REMEMBER THAT.
I was able to test it in early stage and it was awesome
I see that thumbnail EVERYWHERE
Not sure what else has been added
like that thumbnail has been used by different people too
Would it make sense to throw my name into most of the code? The issue, ai csn easily remove it lol
But then again, they can still steal the addon without any changes
Make sense yes but still easily removable
Yeah
That's why the best case, just open source it
True
The name "Prowl" is familiar
yeah, it got to a good point
but i hate that code for some reason
https://www.youtube.com/watch?v=Rz3RKzubHpo&feature=youtu.be
الفيديو عبارة عن استعراض لتقدمي فتطوير الربلاي مود لماينكرافت الجوال
i ain't opening it.
-# i only have 500mb of data left. Lmfao
1min compressed video
Impressive!
is this a new one? Cause I got deja Vu that you showed this to me way way before.
and afaik you even said you used a lot of dynamic property
EVERY TICK
that part is not in the released addon
hence the stolen one don't have it too lol
Lesson learned, don't do testers without making it open source
you have no idea
also you're safe if you use open source since it has history when you edited it and what you edited/added
Especially if GitHub
-# tho I rarely use GitHub now.
Whaa is that.
My terrible border code
learn any thing from it -> yoink any thing from it
No, seriously, I don't know how to make it work at this point
1.20.80 is crazy
Wait nvm, I think I started js in 1.20.30?
i forgor
Even by using ticking areas, it still won't fill the chunks because the surface blocks algorithm that I use doesn't use ticking areas as well
blocks are performance expensive
use particles
1 big ass particle
it has long range and doesn't do TPS drop (in my case)
HEY @inland merlin 😏
I see stolen addons all the time (or at least scripts) lol open it up see to a bunch of another persons name in it
I tried with one of the particles in this forum channel, but that particle doesn't work with 500 blocks of range for example
my first one was before 1.20
still not stable to this day
Lol
I shared with @dim tusk something and he's made it better. I feel like it would be a good resource
To share for particle walls
spawn it only when the player is near the border
Wadahell don't pass it to me 😭
Lmao
That particle is a literal square area
Eh fine ill post the resource today later
For particle walls, it will greatly improve border addons
Like world borders etc
Or anything really
noice
Yeah, in all seriousness I kind made it better. I literally spend 20 minutes just to properly align 4 particle as a 16x16 chunk area
use math
then I made some small calculation that just make the particle stretch based on the size of the selected area
what's math?
Examples... I changed color according to @dim tusk idea of white, but image is old
Yes that includes roof and floor
OPM lol
500x500 wall
No lagg, just need logic to stop players from passing etc..
pirating manga in minecraft
Where's tatsumaki... Rahhhh!!!
Hahaha, I will make a manga book in Minecraft using server form
I was tryn to recreate that Java edition skyblock wall
Thanks Minato 😀
Give people seizures
Do it haha
Had to match uv for scale
dakonblackrose did make a manga bookshelf
Thank you sensei
Mangadex bro
Yeah i remembered that but he used crafting table
and this making every crafting table have manga of genshin impact
LMFAO
Lmao
Not that one.
i do remember it
can't find it tho
You gonna add the instant form ui? Removes the animation
Makes it feel instant
Or want it feel like it's changing
It's easy to do that.
-# coming from a person who is only 2% in json ui
Yeah i do all the time
uhm...
so a book ui template?
So idea time, and I'm good if yall steal it.. as it might lagg anyways lol
Herobrines chestformdata, instant transitions + Crates addon
Of course there is better uis out there, but I'm learning json ui lmao
Or like this.
that is impossible actually
But
If i constantly close form, and open
How much lagg lol
Feel like a form refresh
Are you talkibg about my video?
I tried a lot of high quality image and never had an issue rn
Welp, that's nice
Ngl, unimportant but I like the wasd jump sneak and my time in my actionbar
Not the same form that's open, but like actual refresh
You doing the same form?
Reopens the form and closes it.
I have yet to test, but will this week
Yeah, but let's welcome... Lag and the annoying animations
Especially if you have low ping in the server if that's the case
it will blink no matter what
unless it is the same form
It doesn't blink for me
But maybe if lagg is introduced
It will
which one
if you're talking about Herobrine
He modified the animations and you can move a split second if you clicked buttons
But this system doesn't require editing the animations.
How To Make Readable Bookshelf In Minecraft Bedrock Edition tutorial in mcpe or bedrock edition or xbox one and ps5. Minecraft Hey guys it's dakonblackrose here and in this Minecraft video i'm showing a addon that makes book shelf more cool for minecraft in the new B.T.U !! Minecraft Bedrock MCPE ( Pocket Edition ) XBOX One / Java / Windows 10 /...
Fair, I do like your version best, but for constant information updating...you would have to reopen it right
For me
I am gonna create some sorta stock market addon
Visually yes no blink but actually? No. Especially if you can see your cursor disappears then reappear
Yes that one HAHA
That shit is funny and amazing to me since I don't do json ui... Till this now but meh
Haha, same.
I know a very small amount of json ui, just some logic to modify
Like compatible
I mean I do but in a sense that experienced or know at least? I doubt Soo lmao
Imma modify this to match the portfolio look or a different design
crap as in shit? Or crop? Or calling it as things
Lol I actually said crap
lol
it depend on the addon/content
Ahh.
Yeah, I have been wanting to find time for it
Someone lend me free load pls 😭🙏
const maxSpin = 15;
function rotateBlock(block) {
const currentState = block.permutation.getState("JCTbuild:spin");
let spinValue = currentState || 1;
let newSpin = (spinValue % maxSpin) + 1;
const newPermutation = block.permutation.withState("JCTbuild:spin", newSpin);
block.setPermutation(newPermutation);
}
world.beforeEvents.itemUseOn.subscribe((event) => {
const { source: player, block } = event;
const mainhand = player.getComponent("equippable").getEquipment(EquipmentSlot.Mainhand);
if (player.isSneaking && mainhand?.typeId === "minecraft:wooden_sword") {
system.run(() => rotateBlock(block));
} else {
console.log("Rip.");
}
});```
Could someone tell me why this script is not rotating this block
-# jk
at <anonymous> (test.js)``` error here
Does the state actually exists in the block?
i did state it?
yikes, could you add a js code block?
^ yeah that's my first question does it exist? It won't throw that unless it's on the block rbh
send your Block json?
not sure but I feel like uppercase namespace on states won't work
Unless I'm wrong.
"description": {
"identifier": "...."
//...
"states": {
"<name>" {
//...
}
}
}```
Just check the docs for more confirmation
"format_version": "1.21.40",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_block",
"states": {
"wiki:string_state_example": ["red", "green", "blue"],
"wiki:boolean_state_example": [false, true],
"wiki:integer_state_example": [1, 2, 3],
"wiki:integer_range_state_example": {
"values": { "min": 0, "max": 5 } // The same as [0, 1, 2, 3, 4, 5]
}
}
},
"components": { ... },
"permutations": [ ... ]
}
}```
this was the doc said
"wiki:integer_range_state_example": {
"values": { "min": 0, "max": 5 } // The same as [0, 1, 2, 3, 4, 5]
this
is what i copied
but you forgot to add it is Inside of "states": {} object
"description": {
"identifier": "JCTbuild:acaciatriangle",
"menu_category": {
"category": "construction",
"group": "itemGroup.name.concrete"
},
"JCTbuild:spin": {
"values": {
"min": 0,
"max": 15
}
}```
look LMFAO
3k line or file? 💀
ahh. Simply mistakes
files

one file for each line
one block .json
3k of them
the mega constuction pack
3k varients of blocks to build with
and a wand to rotate them
you are not hitting the permutation limit?
"identifier": "JCTbuild:acaciatriangle",
"menu_category": {
"category": "construction",
"group": "itemGroup.name.concrete"
},
"states": {
"JCTbuild:spin": {
"values": {
"min": 0,
"max": 15
}
}
}
},```
is this right?
i dont think so
one permution namespace
and 0-15 ways to roatate
not really
ive found an addon that u cant see all the files
u can see them only on game files
and still they are obfuscated
i mean even marketplace addons are not save from that
obfuscated or whatever
just dont publicate addons
fr lol
private use addons are the safest
lol
How?
I can confidently say that Minato, Serty and I are a trio. Imagine the hyra dragon meme. Minato the Intelligent, Serty the serious one and me. Just stupid
lol, how is that related

is there a way to make it run slower?
isnt it like tick or something for the script
wym? the topic or the dragon meme
yes tick
it's a range
In ticks
HAHAHA
dude that is awful
im so sorry that happened to you
i had made a world edit for bedrock quite a long time ago, that a respected bedrock content creator i was friends with, took my code and got about 800k views on it last I checked
it crushed me and i have barely shared my code since
i now have this new project and im terrified for it to be taken from me
is their any way to replicate a slime blocks bounce?
ill probably use ai to destroy variable names and add tons of unnecessary code, then obfuscate it, to at least deter or slow down
That's the neat part, you can't do anything to stop it other than marketplace it, open source or never share it at all
horrible
i mean it is part of a scripting laguange thats public so
still shitty you can put so much time and effort into something, and have it ripped and you discredited
ill probably try to put it on my channel first, let it grow then share
thats what id do
Unfortunately the average Minecraft experience.
I like sharing my creations, mostly scripting libraries. I can't recall the last time I released an add-on that wasn't open sourced.
meh i dont expect to get rich so idc if it gets ripped or not
if i know i did it i can atleast feel acomplished
and ik for a fact theres alot of code most creators use as a base for their scripts anyways. like destructuring scripts to make them readable i know alot do that and its basicly all the same just
formatted for their addon
||me who always destructure afterEvents||
lol
I hate destructuring events.
yep, btw this is how i see it
lol
for me its easier to read super adhd most of the advanced shit its like trying to read chinese if you speak english
Serty, you, me.
totally didn't waste my time designing that
Just for a single image?
My god this guy's Patience is insane
Damn, I need to find a way to convert bindings to variables or make the binding readable to variables ughh
you dont know patience untill ur 3 yr old is putting shoes on
I have a 3 year old nephew
Bro can't even talk
As someone with 6 younger siblings, I can only imagine.
its like watching a tree grow
yep
mines put hers on upside down
i dont even know how she manged tha
my oldest mistook her fuzy sweater as a skirt once
At least he/she tried.
Are you talking about the resources like posted in here, or a decomp of someone’s private addon?
Sharing an addon info isn't stealing if open source, its mostly when someone tries reselling an addon that is not even theirs
I don't care if someone wants to sell their own addon, that's fine even if it's against the eula, it's the reselling of someone else's work
Claiming it as their own
Is also a crime
Even if free
i read that wrong the first time lol
"I stolen addons all the time ..."
i was like "huh! ok...?"
Lmao
that doesn’t sound like you
sorry for misunderstanding that, lol
Alright, wanted to make sure I was following the convo, ty
const { source: player, block } = event;
const mainhand = player.getComponent("equippable").getEquipment(EquipmentSlot.Mainhand);
if (player.isSneaking && mainhand?.typeId === "JCTbuild:wrench") {
system.run(() => rotateBlock(block));
} else {
console.log("Rip.");
}
});``` Could someone help me with this
the wrench wont work
but if i use a vannilla item
it works
Does your item have a use modifiers componentM
"format_version": "1.21.10",
"minecraft:item": {
"description": {
"identifier": "JCTbuild:hammer",
"menu_category": {
"category": "equipment"
}
},
"components": {
"minecraft:use_modifiers": {
"use_duration": 99999,
"movement_modifier": 1
},
"minecraft:can_destroy_in_creative": false,
"minecraft:food": {
"can_always_eat": true,
"nutrition": 0
},
"minecraft:hand_equipped": true,
"minecraft:display_name": {
"value": "Hammer"
},
"minecraft:max_stack_size": 1,
"minecraft:allow_off_hand": true,
"minecraft:icon": "jcthammer"
}
}
}```
yes
This says hammer not wrench.
Also avoid capital letters in your identifiers.
Idk where to ask this but does anyone know how to setup the minecraft debugger vsc extension, if yes can you help me set it up please i have tried it is not working for me
ok so i have read this before and i am a bit confused, what i understood is you make .vscode folder in the addon's BP folder and then inside that .vscode folder you make a launch.json file
Yeah.
"version": "0.3.0",
"configurations": [
{
"type": "minecraft-js",
"request": "attach",
"name": "Debug with Minecraft",
"mode": "connect",
"preLaunchTask": "build",
"targetModuleUuid": "d1c183fe-0c37-11ec-82a8-0242ac130003",
"localRoot": "${Origins 1.4.2 BP}/scripts",
"port": 19144
}
]
}
```, this is what it looks like, i have changed the `targetModuleUuid` to the script uuid and `localRoot` to the addon folder and port
idk what's wrong
then i started debugging with a world open with this addon and i also used the /script debugger connect command
How can I make the player.nameTag not be removed when I exit the game?
Save the current nameTag value and apply it the next time they join
could you give me an example?
Just save the player's custom nametag with player.setDynamicProperty('name', player.nameTag);
And then get that property again on the playerSpawn event
Ty
make a script to find all obsidian blocks and then place a block ontop of it
I already tested but I deleted everything because it made error after error
replace connect to listen, then start the debugger in vscode and open minecraft then run /script debugger connect
Didn't work
i seen that
Is it just me or did a message disappear
yeah, i was trying to understand his problem and the messages gone
I deleted them because I thought it was better to create a thread
Anyone know of a Mining addon that generates random mines and rests them? For prison mines, kinda like mines+ when Aex released it
eh, can someone explain to me how the randomTick component works?
What about it?
like does it require "minecraft:tick" block component
how does it work exactly?
It does not.
It will randomly tick. As the name implies. Via the chunk's random tick system.
oh i see,
I wonder why one would want to show manga in Minecraft, but whatever lmao
How do I make language-specific text appear in a script?
Like, access a string in en-US.lang through javascript
You can't, sadly.
Best you can get is raw text translates, which is supported in a few places (forms, send messages, etc)
How can I get the max possible state from a block?
you cant until mojang makes deviceInfo.launguage
or you can make a custom launguage setting
anyone know a vps that i can buy, first time trying to use one
Any block or vanilla?
I think pebblehost has good VPS services, bisect hosting has them too but they're more expensive
On all obsidian blocks in how big of an area? Everywhere? At the same time?
Because to know if a diamond block exists somewhere, the volume needs to be scanned for those diamond blocks. If the volume is the entire loaded, known world, that would take a very long time to execute.
So I am going to save every player's island in my skyblock with structures, but the starting size is 50x192x50, from y-64 to y128 and it takes up a little over 3MB each. Is there any other way to save space other than just the size of the structure?
(was a script api question because I am using script api to save and load the islands)
How can you test for blocks in a box volume? Like for example
TOP (x = 100, y = 64, z = 120)
BOTTOM (x = 100, y = 40, z = 140)
if all blocks have been destroyed in that box area
Tried looking through documentation but just don't know what to use
And block volume doesn't help? It is beta though so I'm not sure where you looked. What have you tried?
Anyone had issues with item dynamic properties not being persistent upon world reload?
Is this intended behavior?
I'll update my game to the latest stable version and try again
yesss it's fixed in the current version
I spoke too soon. Testing some things now...
It seems to happen at random on world reload. Not all reloads, but some
Haven't tried anything, just tried looking through documentation, just can't work out what I need to use, I've had a suggestion but idk, still looking for more to compare
Well, blocked volume is what you need to do to pull all the locations for a given range and within there you can specify options so you would end up with an array of locations and then using something like a run job. Job you can cycle through those blocks because if there's a lot then it takes longer than a tick so you have to use something that can yield to it.
Okay following up on this:
I setup a system where a redstone lamp would turn off only if an item didn't have an expected property. I then restarted my game a couple times, and the lamp was off.
I even kept a copy of this item inside a DATA+ chest inside another chest placed in the world. This "hidden" item also lost its property.
Other items with dynamic properties also lost their properties. It seems like rarely, every single item in the world can lose its dynamic properties.
I am trying to find a way to reproduce this bug purposely, but am yet to find anything. If anyone has experienced this too, please let me know.
...
I believe I have found the issue. Changing the manifest script module uuid breaks item dynamic properties.
In the base code it must be that item dps are directly associated with the module uuid. So if the uuid changes, the properties don't exist on the item. Which I guess prevents addons from accidentally overriding other addons item dps
surprised you didn't know that lol
why are you changing it btw?
also, i believe if you returned the original uuid the properties will be there
I was using regolith and an old version of the gametests filter, where it randomized the uuid on every script change lolll
that's why I was so confused and lost
I thought I was running into the world's strangest bug
I'm back from sober.
what dose that mean 
you are drunk now?
Not drunk lol. I'm back from not having the internet for 2 days lmao
oh, i was wandering about that

I literally said I only 500mb of data left
Yes I use prepaid
I'm poor asf
how much you pay a month for internet subscriptions?
Wait are you talking about available post paid internet? No I don't use post paid since I go out a lot
my prepaid only lasted 7 days and I paid 99 PH pesos
i mean there is movable wifi that work without adsl
i have a pocket wifi but it's the same that I use load prepaid since it can only accept prepaid lol
that doesn't sound that bad
yeah I know since I'm not that big of a consumer unless I'm playing online games
And I'm not studying oof
how do i convert the degrees of getRotation into a vector 3? similar to getViewDirection but for the body
then you should know
which side is x, z, y
y is ez rot.x / 90
but for x,z you should test
x = cos(yaw)*cos(pitch)
y = sin(yaw)*cos(pitch)
z = sin(pitch)
https://stackoverflow.com/questions/1568568/how-to-convert-euler-angles-to-directional-vector
idk minecraft follows that rule
ah i see thank you, altho is there roll axis?
no
roll would be like spinning the player's view around
clockwise
or whatever
pretty sure x is pitch and y is yaw
could be the other way around though
alright, thanks again
Xml is weird fr
Try Android Development. 👀
any block
Oh no, i haven't decided to completely lose my sanity yet
Can someone help me with that script of detecting if player is on specified block and if so and he has tag, it will teleport him to the closest entity
system.runInterval(() => {
const players = world.getPlayers();
for (const player of players) {
const blockUnder = player.dimension.getBlock(player.location);
if (!blockUnder) continue;
const blockBelow = blockUnder.below(1);
if (!blockBelow) continue;
if (blockBelow.typeId === "minecraft:lime_stained_glass") {
const testEntities = Array.from(
player.dimension.getEntities({
type: "test:test",
location: player.location,
maxDistance: 150,
})
).filter((entity) => entity.location);
if (testEntities .length > 0) {
const closestEntity = testEntities .reduce((closest, current) => {
const currentDistance = current.location.distanceTo(player.location);
const closestDistance = closest.location.distanceTo(player.location);
return currentDistance < closestDistance ? current : closest;
});
const targetLocation = closestEntity .location;
player.teleport(targetLocation, { facing: player.location });
}
}
}
}, 1);
What's the problem?
umm does distanceTo function exist? I mena in scripting API rn. I don't think so right?
Yeah... but, it is working in the other my script. Where I detect tag on entity. And there is no error, so it should work either way
Here is the working code:
system.runInterval(() => {
const players = world.getPlayers();
if (players) {
for (let player of players) {
const blockUnder = player.dimension.getBlock(player.location);
if (!blockUnder) continue;
const blockBelow = blockUnder.below(1);
if (!blockBelow) continue;
if (
blockBelow.typeId === "minecraft:lime_stained_glass" &&
player.hasTag("parkour_morph")
) {
const teleportPointEntities = player.dimension.getEntities({
tags: ["teleport_point"],
location: player.location,
maxDistance: 150,
});
if (teleportPointEntities.length > 0) {
const teleportPoint = teleportPointEntities.reduce(
(farthest, current) => {
const currentDistance = current.location.distanceTo(
player.location
);
const farthestDistance = farthest.location.distanceTo(
player.location
);
return currentDistance > farthestDistance ? current : farthest;
}
);
const targetLocation = teleportPoint.location;
player.teleport(targetLocation, { facing: player.location });
}
}
}
}
}, 1);
block.typeId
can someone help me pls?
how to detect if an entity is visible on the player's screen?

edit
if (angle >= -45 && angle <= 45)
for changing the fov
wat
alright I'll check that out
in?
in my question, is in the thread
function loadStructure( blockLocation) {
const block = world.getBlock(block.location);
if (block) {
const treeTypeId = block.typeId ;
// Construct the command string
const command = `structure load ${treeTypeId} ${block.location.x} ${block.location.y} ${block.location.z}`;
entity.runCommand(command);
}
}```
what is wrong about this ?
try runCommandAsync, some commands dont works in runCommand
ooo
not what i need though
What then
Also, your code is not correct because the world.getBlock method does not exist. Because you also need dimension. So it's better to take the Block type as an argument. and load the structure something like this: world.structureManager.place(block.typeId, block.dimension, block.location)
thanks thanks
How do I make an arrow piercing?
im trying to make a script that whenever a tnt explodes, ( or on fact any entity ) it spawns it again, multiplied so like 1 2 4 8 16 .......
i just cant figute it owt
can anyone help
why not hook to entityDie, get the ID and location of the mob that died, and spawn two?
Don't you think Minecraft crashes in a minute?
ik i just want to see it
wait
maybe
Muhaha
I will help you
But actually tho
Serty is probably cookin' 🔥
So ima let him cook
world.beforeEvents.explosion.subscribe(data => {
if (data.source) {
let loc = data.source.location
system.run(() => {
for (let i = 0; i < 2; i++) {
data.dimension.spawnEntity(data.source.typeId, loc)
}
})
}
})
Server load
Yessirrr
should make a variable for entity
?
Server will become a pipebomb in exactly 1 explosion, order 1 mc explosion and get 1 free real life explosion! (Completely for free)
|| Price: your computer ||
Nah
||Price: your life||
time to see if the game will crash
:fire;
🔥

for some reason
it only spawns it once
i mean it does it every time
You copied this before I added the loop.
Is it possible to add a value to a variable? For example, every time a player hits a certain entity, a number is added to the value.
there anyway to make a mob attack any mob?
yes
let hit = + 1;
Or something like that?
let hit = 1
hit += 1
//hit is equals to 2
Damage command or method yes.
Ty
world.beforeEvents.entityInteract(data => {
let player = data.source;
if (entity.typeID === "jay:wheat_minion") {
system.run(() => main(player));
}
function main() {
const form = new ActionFormData()
.title(title)
.button(`§c§lClaim Wheat\n§7+0`, "textures/items/wheat")
.button(`§0§lClose`, "textures/blocks/barrier")
form.show(player).then(r => {
if (r.selection == 0) weapons(player)
if (r.selection == 1) utility(player)
})}})```
where is line 46 lol
There is no entityInteract, you may have meant playerInteractWithEntity. You also did not define entity
world.beforeEvents.entityInteract -> world.beforeEvents.playerInteractWithEntity.subscribe
also it's target if you're wondering
okay I changed it up but now its just not opening the UI, I dont have any errors in my log
import { system, world } from "@minecraft/server"
import { ActionFormData, ModalFormData } from "@minecraft/server-ui";
system.runInterval(()=>{
let property = "jay:wheat_minion"
for (let entity of world.getDimension("overworld").getEntities()) {
if (entity.typeId === "jay:wheat_minion") {
let dynamicProperty = entity.getDynamicProperty(property);
if (dynamicProperty === undefined) {
entity.setDynamicProperty(property, 60)
} else
if (dynamicProperty > 0) {
entity.setDynamicProperty(property, dynamicProperty - 1);
} else
if (dynamicProperty <= 0) {
entity.setDynamicProperty(property, 60);
entity.runCommandAsync("execute @s ~~~ playanimation @s animation.wheat_minion.finish");
entity.runCommandAsync("execute @s ~~~ say Produced Wheat");
entity.runCommandAsync("execute @s ~~~ particle minecraft:totem_particle");
}
entity.nameTag = `§6Wheat Minion\n§7[ §fProduces in: §c${entity.getDynamicProperty(property)}§fs §7]`
}
}
}, 20)
world.beforeEvents.playerInteractWithEntity.subscribe(data => {
let entity = "jay:wheat_minion"
let player = data.source;
if (entity.typeID === "jay:wheat_minion") {
system.run(() => main(player));
}
function main() {
const form = new ActionFormData()
.title(title)
.button(`§c§lClaim Wheat\n§7+0`, "textures/items/wheat")
.button(`§0§lClose`, "textures/blocks/barrier")
form.show(player).then(r => {
if (r.selection == 0) { main(player)
player.runCommandAsync("say claim wheat");
}
})
}
})```
ohh my god
world.beforeEvents.playerInteractWithEntity.subscribe(ev => {
const { target, player, itemStack } = ev;
if (target.typeId === '<if>') {
system.run(() => main(player) );
}
});```
Yeah it's kinda bad
spawnParticle exists btw
i just have it like that so ik its working guys
world.beforeEvents.playerInteractWithEntity.subscribe(ev => {
const { target, player, itemStack } = ev;
if (target.typeId === 'jay:wheat_minion') {
system.run(() => main(player) );
}
})
function main() {
//line 35 const form = new ActionFormData()
.title(title)
.button(`§c§lClaim Wheat\n§7+0`, "textures/items/wheat")
.button(`§0§lClose`, "textures/blocks/barrier")
form.show(player).then(r => {
if (r.selection == 0) { main(player)
player.runCommandAsync("say claim wheat");
}
})
}```
wait i think thats my fault on my end
nvm im not to sure
import { system, world } from "@minecraft/server"
import { ActionFormData, ModalFormData } from "@minecraft/server-ui";
system.runInterval(() => {
const property = "jay:wheat_minion";
for (const entity of world.getDimension("overworld").getEntities()) {
if (entity.typeId === "jay:wheat_minion") {
let dynamicProperty = entity.getDynamicProperty(property);
if (dynamicProperty === undefined) entity.setDynamicProperty(property, 60);
else if (dynamicProperty > 0) entity.setDynamicProperty(property, dynamicProperty - 1);
else if (dynamicProperty <= 0) {
entity.setDynamicProperty(property, 60);
entity.playAnimation("animation.wheat_minion.finish");
entity.runCommand("say Produced Wheat");
entity.dimension.spawnParticle("minecraft:totem_particle", entity.location);
}
entity.nameTag = `§6Wheat Minion\n§7[ §fProduces in: §c${entity.getDynamicProperty(property)}§fs §7]`;
}
}
}, 20);
world.beforeEvents.playerInteractWithEntity.subscribe(data => {
const { target, player } = data;
if (target.typeId === "jay:wheat_minion") {
system.run(() => main(player));
}
function main(player) {
const form = new ActionFormData()
.title("Wheat Minion")
.button(`§c§lClaim Wheat\n§7+0`, "textures/items/wheat")
.button(`§0§lClose`, "textures/blocks/barrier");
form.show(player).then(r => {
if (r.selection === 0) {
player.sendMessage("say claim wheat");
main(player);
}
});
}
});```
true²
player.runCommandAsync("say claim wheat");
thank you 🙏 so basically for entity stuff just put entity.<wtv>
not always
wdym
Debug result for [code](#1067535608660107284 message)
Compiler found 4 errors:
[36m<REPL0>.js[0m:[33m10[0m:[33m16[0m - [31merror[0m[30m TS2365: [0mOperator '>' cannot be applied to types 'string | number | boolean | Vector3' and 'number'.
[7m10[0m else if (dynamicProperty > 0) entity.setDynamicProperty(property, dynamicProperty - 1);
[7m [0m [31m ~~~~~~~~~~~~~~~~~~~[0m
``````ansi
[36m<REPL0>.js[0m:[33m10[0m:[33m73[0m - [31merror[0m[30m TS2362: [0mThe left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type.
[7m10[0m else if (dynamicProperty > 0) entity.setDynamicProperty(property, dynamicProperty - 1);
[7m [0m [31m ~~~~~~~~~~~~~~~[0m
``````ansi
[36m<REPL0>.js[0m:[33m11[0m:[33m16[0m - [31merror[0m[30m TS2365: [0mOperator '<=' cannot be applied to types 'string | number | boolean | Vector3' and 'number'.
[7m11[0m else if (dynamicProperty <= 0) {
[7m [0m [31m ~~~~~~~~~~~~~~~~~~~~[0m
``````ansi
[36m<REPL0>.js[0m:[33m14[0m:[33m16[0m - [31merror[0m[30m TS2339: [0mProperty 'sendMessage' does not exist on type 'Entity'.
[7m14[0m entity.sendMessage("Produced Wheat");
[7m [0m [31m ~~~~~~~~~~~[0m
ESLint results:
<REPL0>.js
2:26 error 'ModalFormData' is defined but never used @typescript-eslint/no-unused-vars
37:9 warning The /say command can be fully replaced with the World.sendMessage api in the @minecraft/server module. See https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/world#sendmessage for more information. minecraft-linting/avoid-unnecessary-command
not everything exists in Entity
God, don't use the debugger here 😭
what are these errors 😭
Ooh, didn't remembered Send message don't work on entities lmfao
yes I saw this.
This debugger is actually not very smart
wdym
yeah i changed that back to the command one, since ima run a function off it
the debugger is right about everything there
okay so I threw in my getScore, from my other script but I get a error.
const getScore = (participant, objective) => {
try {
return world.scoreboard.getObjective(objective).getScore(participant) ?? 0;
} catch {};
return 0;
};
function metricNumbers(value) {
const types = ["", "k", "M", "B", "T", "P", "E", "Z", "Y"];
const exponent = Math.floor(Math.log10(value));
const selectType = Math.min(Math.floor(exponent / 3), types.length - 1);
return value < 1000 ? value.toString() : `${(value / Math.pow(10, selectType * 3)).toFixed(1)}${types[selectType]}`;
};
world.beforeEvents.playerInteractWithEntity.subscribe(data => {
const { target, player } = data;
if (target.typeId === "jay:wheat_minion") {
system.run(() => main(player));
}
It is possible to remove messages when someone makes an emote?
Aww. getting ignored?
Yeah buddy, I always feel them from my friends.
use this 😭
edit the lang file
my lazy ass will just typeof lol
Debug result for [code](#1067535608660107284 message)
Compiler found 2 errors:
[36m<REPL0>.js[0m:[33m18[0m:[33m22[0m - [31merror[0m[30m TS2304: [0mCannot find name 'main'.
[7m18[0m system.run(() => main(player));
[7m [0m [31m ~~~~[0m
``````ansi
[36m<REPL0>.js[0m:[33m20[0m:[33m1[0m - [31merror[0m[30m TS1005: [0m'}' expected.
[7m20[0m
[7m [0m [31m[0m
[36m<REPL0>.js[0m:[33m15[0m:[33m63[0m
[7m15[0m world.beforeEvents.playerInteractWithEntity.subscribe(data => {
[7m [0m [36m ~[0m
The parser expected to find a '}' to match the '{' token here.
ESLint results:
<REPL0>.js
20:0 error Parsing error: '}' expected
Ohh my god, djnr use the debugger heere
sorry 😭
#debug-playground 🙏
i used the debugger and it gave me errors that I do not have/need help with 😭
|| I don't understand why they don't understand. ||
the error is self explanatory anyway
i figured it out sorry about that I didnt have the objective in yet
still learning js 🙏
\
hi there, is it possible to spawn particle on a entity so the particle follows the entity while it is still active?
Thats more of a #1067869590400544869 or #1067869022273667152 question. The following part anyways.
What are the conditions for playerInteractWithEntity
Do i need to have like
An interaction button or just right click/long tap
Or neither
Cuz I'm thinking whether i should use that or itemUse and try to get the target entity from that
I believe the entity needs to have the itneract component.
Oh, thank you then
Tada.
nvm again lol
beforeEvents work with all entities
afterEvents work as you said
Ah yep. I commented that in my code.
BeforeEvents also works with empty hand but after does not last I checked as well.
One question
Since there seems to be no visible result
Do i need to apply setLore to event.itemStack or manually fetch the current item
wdym
Which part are you confused about?
no visible result of what
So I'm trying to apply setLore to the item that was used on the entity, and there seems to be no lore added
applying the lore.
event.itemStack is just a copy of the item
Oh, that explains a lot
you need to set the item to the same slot
you need to set the item back in the slot after editing properites
yes
almost the same sentence lol
almosttt
player.getComponent('equippable').setEquipment('Mainhand', item)
// or...
player.getComponent('inventory').container.setItem(player.selectedSlotIndex, item)
// if you want to set the item in other slots obviously change player.selectedSlotIndex to the slot you want.
i wonder if there any performance different
just do either of these after editing properties
doubt it
yeah
is there a way to stop people from dropping items?
like disable the permission from the player
no
ugh
Lock the item?
For a psuedomethod that could definitely work, yeah
do structures saved to the world (not loaded, just saved) take up storage? is it minimal, possibly?
Like a structure using scripts that uses the player's ID for a template structure like a base, but 100 players have the same structure saved, would it take up a lot of space just sitting as a structure that has been unloaded
It's saved to the leveldb.
hi Salty sean
having a good day ?
Just as there is setOnFire, there is something like setOnFrezzing or something to similar the snow effect.
None.
you can give the player a freezing damage I guess but not the effect in screen
I suppose that with json ui and a title you can add the effect on the screen
.button("§sSpeed\n§a$§2" + world.scoreboard.getObjective('minionSpeedPrice').getScore(target) + world.scoreboard.getObjective('minionSpeedPrice').getScore(target), "textures/items/diamond_hoe")```
is there anyway to make this so i can have text inbetween the 2 scores?
so it looks like this
You using "+" to concatenate the strings is adding each string directly to the end of the last one
so remove the "+"?
So you need to do "$§2" + "1400" + " " + "(" + "1" + ")"
no, just add spaces using +
replace "1400" and whatever to the code you're using to get those values
just take away the quotes or use `` (top left of keyboard with the ~)
`${world.scoreboard.....}` is a string version of the code you're trying to use
Could someone help me please?? im trying to make my entity deal an area attack using applydamage, but idk what is not working :((
i got it working thank you!
oooh, I was trying to figure that out
i used that a little while ago for a different project
It's called "Template Literals" if you want to find the js docs
yeah i probably will end up
you can use one string using back ticks (`) and just use ${} for the code, all in one string
wait fr?
`Speed\n$${code here} (${code here})`
it also is useful for converting things to strings
like getting a scoreboard value
do `${scoreboard value (number)}`
and it turns it from type number to type string
if you need to use a function or something that can't input numbers
yes I just unlocked many things for you
to many things for me
let your mind wander
im about to, again i appericate it thank you! 🙏
Is there a way to check how much time does my script takes?
it doesn't deal any damage to the entities nearby :((
welp, perhaps rewrite the queries
Date.now() at the start, Date.now() at the end, subtract the two
Thanks
is it possible to make it so when my entity is placed it spawns a structure?
something like this
Does anyone know what's wrong with this code var health = player.getComponent("minecraft:health"); health.setCurrentValue(Math.max(health.currentValue+1,health.effectiveMax)); ,it's giving me this error
#1328063777844756561 message
Thank you so much
And use let instead of var
it says that it occurs in before events but i am using an after event
also why let and not var
show full code
var is quite old and as far as I know it does not work exactly as it should.
#1302741120081723563 message
How long have you been looking for this message?
I already knew about it so it didn't take me long. I just logged on. Saw the question above so I snatched it up for them so they could read it.
thank you :D
There are 29 errors from compiler, and 0 errors from ESLint in this [code](#1067535608660107284 message).
Please read the attached file for the result.
#debug-playground please
@somber cedar stop doing the debugs here pls?
how would u detect block, not broken by player? or broken by blast or anything else
world.getDimension('overworld').getEntities().forEach((entity) => {
if (entity.typeId == "minecraft:item") {
console.warn(entity.nameTag)
if (entity.nameTag.startsWith("§cDamage Reduction §7I")) entity.runCommand("say hi")
}
})
``` im trying to get this to work but not even the console warn will show
entity.nameTag or item.nameTag?
?
the item is an entity when its dropped right
so ima tryna detect the item thats dropped
and get its name
use this
i dont use ts
serty after him me too :3
from item component entity.getComponent('item').itemStack.nameTag
the documentation is in ts i dont use ts