#s there a way to remove the sound from all entities

1 messages · Page 1 of 1 (latest)

fossil gust
#

v

lucid mulch
#

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

fossil gust
#

im making a skygen and want to use a ententy for the gens

lucid mulch
#

You'd probably be better off with a custom entity

fossil gust
#

so now i got to remake them

lucid mulch
#

What part of the docs was confusing to you?

#

Also, which ones were you looking at?

fossil gust
#

the entry thing

#

the new block update

#

bc my blocks us events

fossil gust
lucid mulch
#

I mean, you do have 2 options

#

You can use a custom entity

fossil gust
#

bc im remaking a skygen to run on scrits

lucid mulch
#

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

fossil gust
lucid mulch
#

Ah, gotcha

#

Really all it is is a new kind of event

#

I can't really explain more now, as I need to work

fossil gust
fossil gust
fossil gust
#
"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
          ]
        }
      },
lucid mulch
#

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

fossil gust
lucid mulch
#

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

fossil gust
lucid mulch
#

Ah, I don't have time for that actually. Sorry

fossil gust
#

ok but id only need some one like 1 time a mounth

fossil gust
fossil gust
lucid mulch
#

Ok, sounds good

fossil gust
fossil gust
lucid mulch
#

You'd need a custom block

#

I gave the javascript you'll need earlier in the chat

#

and the custom component/tick component

fossil gust
#

my frind said us the blocks id with code

lucid mulch
#

Just put the components I put in the components section of the block

#

and the code I sent into main.js

fossil gust
#

but how would it sent the block to the block

lucid mulch
#

So you want it to set a new block?

fossil gust
#

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

lucid mulch
#

Might be better to open a new post in #1067535382285135923

fossil gust
#

daam

fossil gust
fossil gust
lucid mulch
#

The example I gave has onTick, not onStepOn

fossil gust
#

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

fossil gust
#

and what do i remove on my file

lucid mulch
#

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

fossil gust
lucid mulch
#

Replace the components with the tick and custom_components components I listed above

fossil gust
#

what do i remove out of there

lucid mulch
#

Should just be world and server like most scripts. Make sure you're using the latest stable apis

fossil gust
#

ok

lucid mulch
#

Also, I don't think you'll need to remove anything from your .js file

fossil gust
#

dont have js it is json

fossil gust
#

bc im new to this

lucid mulch
fossil gust
#

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

fossil gust
lucid mulch
#

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

fossil gust
#

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
          ]
        }
      }
  ]
 }
}
lucid mulch
#

You still need go remove the events object

fossil gust
#

ok what else

#

and were do i put the coponets

lucid mulch
fossil gust
#

what ones

#

and were itn it

lucid mulch
#

The ones in my past messages. It needs to go inside of components

fossil gust
# lucid mulch The ones in my past messages. It needs to go inside of components

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
          ]
        }
      }
    ]
  }
}
lucid mulch
#

Almost. You also need to remove on_player_destroyed. Then it should be good

fossil gust
#

ok lets see

fossil gust
#

do i got to update the .geo

lucid mulch
#

The permutations might be an issue as the block state is undefined actually. Try removing them

fossil gust
#

still no

lucid mulch
#

Does your editor lint json? Maybe there's a formatting error somewhere

#

Also, I'm assuming the block doesn't show up in commands?

fossil gust
#

no

fossil gust
lucid mulch
#

Worked fine for me in my testing

#

I'll send my example block

fossil gust
#

ok

lucid mulch
fossil gust
#

what i put for this "identifier": "minecraft:geometry.full_block"

#

@lucid mulch

fossil gust
lucid mulch
#

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

fossil gust
fossil gust
lucid mulch
#

Like, your block, or the block I just sent you?

#

As if it's your block, I'd compare it to mine

fossil gust
#

the block you just sent

#

what do i put for this

lucid mulch
#

Are you sure your min_engine_version is the latest version in the manifest?

fossil gust
#

"minecraft:geometry":{
"identifier": "geometry.tuffgen"
},

lucid mulch
#

The identifier of the model in blockbench

fossil gust
#

what is the new one

#

ok do what i have

fossil gust
fossil gust
fossil gust
#

hello @lucid mulch

lucid mulch
#

Also, please be patient when I don't respond. I will when I'm available, no need to ping me

fossil gust
lucid mulch
#

Like, your function?

fossil gust
#

and what is the latest update and this

fossil gust
# lucid mulch Like, your function?

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

lucid mulch
#

Ah. You'll need to directly set the block with the script

fossil gust
lucid mulch
#

You can use dimension.setBlock

fossil gust
#

how do i set it on top the block and were i put it

lucid mulch
#

use block.location

fossil gust
#

how i go up one

lucid mulch
#

Add 1 to the y value

fossil gust
#

ok and were i put it

lucid mulch
#
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

fossil gust
fossil gust
lucid mulch
#

I suppose you could just use a command to set the block now that I think of it

fossil gust
#

how would i thou bc it did not work

fossil gust
lucid mulch
#

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

fossil gust
#

and how do i make it take like 30s to brake it

lucid mulch
#

I'm not as sure about breaking time, I don't use blocks much

#

And what exactly happens?

fossil gust
#

nun

lucid mulch
#

So no content log errors?

fossil gust
#

no

lucid mulch
#

Ok. I'll test it out myself in the morning

fossil gust
#

hold on

lucid mulch
#

In the meantime, if you want you can try to debug it as well

fossil gust
lucid mulch
#

That's probably the blocks.json issue

#

Could be why it doesn't recognize your block

fossil gust
lucid mulch
#

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

lucid mulch
#

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

fossil gust
#

and how i format the file

fossil gust
#

i did world

lucid mulch
#

try world and system

#

if that was the issue though, you'd be getting content log errors

fossil gust
#

why events like that

lucid mulch
#

Oh, use the code I sent

#

That's what works

fossil gust
lucid mulch
#

It's the code which works for me 🤷

lucid mulch
fossil gust
fossil gust
fossil gust
# lucid mulch Here's what I'm talking about

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]
        }
    ]
}
lucid mulch
#

You aren't using a scripting module

#

that's the issue

fossil gust
#

oh dam

#

how do i put it

lucid mulch
#

Try to add this to dependencies: json { "module_name": "@minecraft/server", "version": "1.13.0" }

fossil gust
#

for all the things

lucid mulch
#

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

lucid mulch
#

What exactly does it say?

fossil gust
lucid mulch
#

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

lucid mulch
#

So change the filepath in the entry section of the script module to the filepath of your script

lucid mulch
#

Strange. Can you send the full manifest?

fossil gust
# lucid mulch 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

fossil gust
lucid mulch
#

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

fossil gust
lucid mulch
#

Why does the entry need scripts/?

#

That's just how minecraft finds the file

fossil gust
lucid mulch
#

Does it still have the same content log errors?

fossil gust
lucid mulch
#

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

fossil gust
#

there

lucid mulch
#

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");

fossil gust
lucid mulch
#

Nope. You can always make a new post