#s there a way to remove the sound from all entities
1 messages · Page 1 of 1 (latest)
You'd need to put all of their entries in sounds.json in a resource pack and make it so they have no sound events
tf
im making a skygen and want to use a ententy for the gens
You'd probably be better off with a custom entity
i had custome blocks but idk how to update then and i dont under stand the docs
so now i got to remake them
so idk how to update it bc my blocks us run command to set the block
bc im remaking a skygen to run on scrits
which will get around the sounds issue
or you can learn scripts
That is rough if the tutorials on wiki.bedrock.dev are confusing
but you can start simpler
ik scripts kust cant understand the new docs
Ah, gotcha
Really all it is is a new kind of event
I can't really explain more now, as I need to work
i have hella learning disability
it is hard for me to ready some stuff
i need to update this
"events": {
"remove:block": {},
"size:block": {},
"step:on": {},
"step:off": {},
"on_tick": {
"run_command": {
"command": [
"function tuffgen"
]
}
},
"random:tick": {},
"fall:on": {}
},
"permutations": [
{
"condition": "query.block_property('block:rotation') == 2",
"components": {
"minecraft:rotation": [
0,
0,
0
]
}
},
Ok, so for that event all you'd need is a ticking custom component with world.runCommand. Something like this: ```js
world.beforeEvents.worldInitialize.subscribe(initEvent => {
initEvent.blockComponentRegistry.registerCustomComponent("example:ticking_function",{
onTick: event=>{
event.block.dimension.runCommand("say hi");
}
});
});```
Then, the block would need these 2 components:json "minecraft:tick": { "looping": true, "interval_range": [20,20] }, "minecraft:custom_components": ["example:ticking_function"]
If you need to do things like set the block, you'll need to code it inside of the brackets after onTick: event
but if you already know scripts, that shouldn't be the hard part
can i dm you to talk about soe thing
I don't accept dms, sorry. I just find it better to talk in public
And it means if I don't kmow, someone else will be able to help
i was going to ask if you wanted to be a part time dev for my server bc i dont need much just need my gens dun and my custom items
Ah, I don't have time for that actually. Sorry
ok but id only need some one like 1 time a mounth
yo look this
i think ima us entatys but make the so thay cant die or move or have a sound
Ok, sounds good
i cant
got to use blocks but idk how i would make it so i can use a ingame block
You'd need a custom block
I gave the javascript you'll need earlier in the chat
and the custom component/tick component
idk were to put that
my frind said us the blocks id with code
Just put the components I put in the components section of the block
and the code I sent into main.js
how would i do that with the block id
but how would it sent the block to the block
So you want it to set a new block?
some like this ye on tope a block with the block id
just i did this
let system = server.registerSystem(0, "blockPlacementDetector");
system.initialize = function() {
this.listenForEvent("minecraft:block_place", (eventData) => this.onBlockPlace(eventData));
};
system.onBlockPlace = function(eventData) {
let block = eventData.data.block;
let blockType = block.__identifier__;
// Check if the placed block is a diamond block
if (blockType === "minecraft:diamond_block") {
this.broadcastEvent("minecraft:display_chat_event", "A diamond block has been placed!");
// Example of giving an emerald to the player who placed the block
let player = eventData.data.player;
this.executeCommand(`/setblock ~~1~ dirt`);
}
};
system.executeCommand = function(command) {
this.broadcastEvent("minecraft:execute_command", {command: command});
};
i tryed can you fi it
fix it
Might be better to open a new post in #1067535382285135923
daam
ok i got it but i dont want it step on haow do i make it do it all the time
what it mean by on step on
The example I gave has onTick, not onStepOn
will that work by its self
or what do i have to do for it to put the block on top of it
ok so do i put this in a
world.beforeEvents.worldInitialize.subscribe(initEvent => {
initEvent.blockComponentRegistry.registerCustomComponent("example:ticking_function",{
onTick: event=>{
event.block.dimension.runCommand("say hi");
}
});
});
main .js
and put one fo each block
or
do i put them all in there own file
and what do i remove on my file
If you want them to do separate things, you'll need different custom components. It can all go in the sane file
Remove the events from your block file, and any components that trigger them
Replace the components with the tick and custom_components components I listed above
what do i remove out of there
ok what do i have to import
sorry im new to block stuff
Should just be world and server like most scripts. Make sure you're using the latest stable apis
ok
Also, I don't think you'll need to remove anything from your .js file
dont have js it is json
but wat do i remove
bc im new to this
Remove what I said from the json. I didn't look at the file as I'm on discord mobile rn, so I assumed it was a .js file from the extension
ok but idk what uses events bc my frind did some of the events
{
"format_version": "1.20.20",
"minecraft:block": {
"description": {
"identifier": "exo:tuffgen",
"category": "Nature"
},
"components": {
"minecraft:destroy_time": 30.0,
"minecraft:friction": 1.0,
"minecraft:map_color": "#FFFFFF",
"minecraft:explosion_resistance": 99999999.0,
"minecraft:block_light_absorption": 0,
"minecraft:block_light_emission": 0.0,
"minecraft:on_player_destroyed": {
"event": "remove:block",
"target": "self"
},
"minecraft:material_instances": {
"*": {
"texture": "gens2",
"render_method": "blend"
}
},
"minecraft:on_step_on": {
"event": "step:on",
"target": "self"
},
"minecraft:on_step_off": {
"event": "step:off",
"target": "self"
},
"minecraft:on_placed": {
"event": "size:block",
"target": "self"
},
"minecraft:random_ticking": {
"on_tick": {
"range": [
10,
10
],
"event": "random:tick",
"target": "self"
}
},
```
"minecraft:on_fall_on": {
"event": "fall:on",
"target": "self"
},
"minecraft:ticking": {
"looping": true,
"range": [
0,
0
],
"on_tick": {
"event": "on_tick",
"target": "self"
}
},
"minecraft:creative_category": {
"category": "nature"
},
"minecraft:entity_collision": true,
"minecraft:pick_collision": true
},
"events": {
"remove:block": {},
"size:block": {},
"step:on": {},
"step:off": {},
"on_tick": {
"run_command": {
"command": [
"function tuffgen"
]
}
},
"random:tick": {},
"fall:on": {}
},
"permutations": [
{
"condition": "query.block_property('block:rotation') == 2",
"components": {
"minecraft:rotation": [
0,
0,
0
]
}
},
{
"condition": "query.block_property('block:rotation') == 3",
"components": {
"minecraft:rotation": [
0,
-180,
0
]
}
},
{
"condition": "query.block_property('block:rotation') == 4",
"components": {
"minecraft:rotation": [
0,
90,
0
]
}
},
{
"condition": "query.block_property('block:rotation') == 5",
"components": {
"minecraft:rotation": [
0,
-90,
0
]
}
}
]
}
}
that is all the code
so what do i remove bc idk what some stuff that uses events
The on_tick part of minectaft:ticking, on_fall_on, random_ticking, on_placed, on_step_off, on_step_on, on_player_destroyed, and everything under events
and what componet i ut it on
what else
{
"format_version": "1.20.20",
"minecraft:block": {
"description": {
"identifier": "exo:tuffgen",
"category": "Nature"
},
"components": {
"minecraft:destroy_time": 30.0,
"minecraft:friction": 1.0,
"minecraft:map_color": "#FFFFFF",
"minecraft:explosion_resistance": 99999999.0,
"minecraft:block_light_absorption": 0,
"minecraft:block_light_emission": 0.0,
"minecraft:on_player_destroyed": {
"event": "remove:block",
"target": "self"
},
"minecraft:material_instances": {
"*": {
"texture": "gens2",
"render_method": "blend"
}
},
"minecraft:creative_category": {
"category": "nature"
},
"minecraft:entity_collision": true,
"minecraft:pick_collision": true
},
"events": {
"remove:block": {},
"size:block": {},
"step:on": {},
"step:off": {},
"on_tick": {
"run_command": {
"command": [
"function tuffgen"
]
}
},
"random:tick": {},
"fall:on": {}
},
"permutations": [
{
"condition": "query.block_property('block:rotation') == 2",
"components": {
"minecraft:rotation": [
0,
0,
0
]
}
},
{
"condition": "query.block_property('block:rotation') == 3",
"components": {
"minecraft:rotation": [
0,
-180,
0
]
}
},
{
"condition": "query.block_property('block:rotation') == 4",
"components": {
"minecraft:rotation": [
0,
90,
0
]
}
},
{
"condition": "query.block_property('block:rotation') == 5",
"components": {
"minecraft:rotation": [
0,
-90,
0
]
}
}
]
}
}
and were i put the componets
did i remove all of them
You still need go remove the events object
You need to add these to components: json "minecraft:tick": { "looping": true, "interval_range": [20,20] }, "minecraft:custom_components": ["example:ticking_function"]
The ones in my past messages. It needs to go inside of components
like this
like this
{
"format_version": "1.20.20",
"minecraft:block": {
"description": {
"identifier": "exo:tuffgen",
"category": "Nature"
},
"components": {
"minecraft:destroy_time": 30.0,
"minecraft:friction": 1.0,
"minecraft:map_color": "#FFFFFF",
"minecraft:explosion_resistance": 99999999.0,
"minecraft:block_light_absorption": 0,
"minecraft:block_light_emission": 0.0,
"minecraft:on_player_destroyed": {
"target": "self"
},
"minecraft:tick": {
"looping": true,
"interval_range": [20,20]
},
"minecraft:custom_components": ["example:ticking_function"],
"minecraft:material_instances": {
"*": {
"texture": "gens2",
"render_method": "blend"
}
},
"minecraft:creative_category": {
"category": "nature"
},
"minecraft:entity_collision": true,
"minecraft:pick_collision": true
},
"permutations": [
{
"condition": "query.block_property('block:rotation') == 2",
"components": {
"minecraft:rotation": [
0,
0,
0
]
}
},
{
"condition": "query.block_property('block:rotation') == 3",
"components": {
"minecraft:rotation": [
0,
-180,
0
]
}
},
{
"condition": "query.block_property('block:rotation') == 4",
"components": {
"minecraft:rotation": [
0,
90,
0
]
}
},
{
"condition": "query.block_property('block:rotation') == 5",
"components": {
"minecraft:rotation": [
0,
-90,
0
]
}
}
]
}
}
Almost. You also need to remove on_player_destroyed. Then it should be good
ok lets see
but it do
do i got to update the .geo
The permutations might be an issue as the block state is undefined actually. Try removing them
still no
still the smaething
Does your editor lint json? Maybe there's a formatting error somewhere
Also, I'm assuming the block doesn't show up in commands?
no
my friend said that this dont exeist
ok
bc it dont work for me
Are you sure you pack is in the development packs?
as this worked for me
So I don't know what to say if the block I sent doesn't work for you
yes
what do i put for this
it say its not in the
Like, your block, or the block I just sent you?
As if it's your block, I'd compare it to mine
Are you sure your min_engine_version is the latest version in the manifest?
"minecraft:geometry":{
"identifier": "geometry.tuffgen"
},
The identifier of the model in blockbench
"min_engine_version": [1, 16, 0]
is this it
and this it waht gose there
hello @lucid mulch
Switch it to the latest update
Also, please be patient when I don't respond. I will when I'm available, no need to ping me
i got it but the command dont work
Like, your function?
and what is the latest update and this
yes this
world.beforeEvents.worldInitialize.subscribe(initEvent => {
initEvent.blockComponentRegistry.registerCustomComponent("exo:dirtgen",{
onTick: event=>{
event.block.dimension.runCommand("Setblock ~~1~ dirt");
}
});
});
my friend said it dont exist
Ah. You'll need to directly set the block with the script
how do i do that one
You can use dimension.setBlock
how do i set it on top the block and were i put it
Oh wait, it's setBlockPermutation: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/dimension?view=minecraft-bedrock-stable#setblockpermutation
use block.location
how i go up one
Add 1 to the y value
ok and were i put it
let blockLocation=event.block.location;
let placeLocation={x: blockLocation.x, y: blockLocation.y+1, z: blockLocation.z};
It goes in the event
Where your command currently is
Use placeLocation to set the block
can i put the cmd to
ummm
can you give me the entyer thing and the command with it
I suppose you could just use a command to set the block now that I think of it
yhay
how would i thou bc it did not work
i would say i could put the custome blocks and use ingame commands to set the block ontop
try
let blockLocation=event.block.location;
event.block.dimension.runCommand("setblock "+blockLocation.x+" "+(blockLocation.y+1)+" "+blockLocation.z+" dirt");
I haven't tested it myself, but it should work
did not work for me
and how do i make it take like 30s to brake it
I'm not as sure about breaking time, I don't use blocks much
And what exactly happens?
nun
So no content log errors?
no
Ok. I'll test it out myself in the morning
hold on
In the meantime, if you want you can try to debug it as well
huh
my friend said use block brake event
That wouldn't make it take longer to break
I know it's a block component, I just don't know the exact details of it as it's a bit wonky
Ok, I just tested the code I sent you. The component is working for me
It must be an issue with your pack
Can you send your manifest?
As well as the updated block file which uses the custom component?
As it may be a script api version issue
what do i import
and how i format the file
bc idk what to import
i did world
try world and system
if that was the issue though, you'd be getting content log errors
i got componet erro for all saying it was not imported
why events like that
i did it dont work for the other ones
It's the code which works for me 🤷
Here's what I'm talking about
i get that
my mana
{
"format_version": 2,
"header": {
"name": "Gens",
"description": "Gens Behavior Pack",
"uuid": "20b26d30-65a6-9e60-3721-ad4c6fd64ba0",
"version": [1, 0, 0],
"min_engine_version": [1, 16, 0]
},
"metadata": {
"authors": ["Jereme"],
"generated_with": {
"blockbench_block_wizard": ["1.2.2"]
}
},
"modules": [
{
"description": "Behavior",
"version": [1, 0, 0],
"uuid": "826093c5-07f5-52bd-901c-86e0bb9d3fae",
"type": "data"
}
],
"dependencies": [
{
"uuid": "a14295d6-d252-3528-af66-3a2eaae013a1",
"version": [1, 0, 0]
}
]
}
Try to add this to dependencies: json { "module_name": "@minecraft/server", "version": "1.13.0" }
it do this now
for all the things
lmk
what to do
Wait, no, I see the issue
I forgot another important part to add to the manifest
Add this to modules: json { "description": "Custom components", "type": "script", "uuid": "<uuid>", "version": [1, 0, 0], "entry": "scripts/main.js" }
Replace <uuid> with a new uuid
it cant find the reg
What exactly does it say?
this for all
You script file is in scripts/main.js, correct? Also, can you send your full manifest so I can double check that you added everything in correctly? Something might be misplaced. As it looks like the script file still isn't being loaded
no
it is in nun
So change the filepath in the entry section of the script module to the filepath of your script
i idid
Strange. Can you send the full manifest?
{
"format_version": 2,
"header": {
"name": "Gens",
"description": "Gens Behavior Pack",
"uuid": "20b26d30-65a6-9e60-3721-ad4c6fd64ba0",
"version": [1, 0, 0],
"min_engine_version": [1, 16, 0]
},
"metadata": {
"authors": ["Jereme"],
"generated_with": {
"blockbench_block_wizard": ["1.2.2"]
}
},
"modules": [
{
"description": "Behavior",
"version": [1, 0, 0],
"uuid": "826093c5-07f5-52bd-901c-86e0bb9d3fae",
"type": "data"
},
{
"description": "Custom components",
"type": "script",
"uuid": "af6433b9-8067-48d2-8dca-2b85b86cce10",
"version": [1, 0, 0],
"entry": "main.js"
}
],
"dependencies": [
{
"uuid": "a14295d6-d252-3528-af66-3a2eaae013a1",
"version": [1, 0, 0]
},
{
"module_name": "@minecraft/server",
"version": "1.13.0"
}
]
}
look im do this
i sent you my vs link go look
Please be patient when I don't respond immediately
The issue is that you don't have the folder for your main.js file
It needs to be in the scripts folder
and entry needs to include that
why do it have to
ok i did it but it is not seting the blocks
Does it still have the same content log errors?
no there is no errors
Ok, Let me see if I can see the code from the liveshare
Doesn't seem to be loading for me, can you send the script here? Just to make sure it's set up in a way that works
there
i had to accepts you
Ah, you're still using the old code
It needs to be replaced with this: js let blockLocation=event.block.location; event.block.dimension.runCommand("setblock "+blockLocation.x+" "+(blockLocation.y+1)+" "+blockLocation.z+" dirt");
got it do yk how to make a npc shop
Nope. You can always make a new post