Skip to main content

Place a matrix of Deny blocks with code or commands

Comments

7 comments

  • Danny Support
    Beacon of Knowledge Bug Zapper Support

    Hey there!

    I just tested and you can do so with the /fill command:

    I believe the maximum at a time to fill in is somewhere around 36,000 blocks, so as long as the area is smaller than that, you can do a large area multiple times.

    Hope that helps!

    1
  • Dani Noble
    Moderator Beacon of Knowledge Super Star

    Hi Ryan Albrey

    Sounds like you have a great project on the go.

    First step is converting the world to Bedrock. You can do this with either chunker, or with Amulet

    Once you have it converted to Bedrock you can import the world into Minecraft Education. From here (as Danny mentioned), you can use fill commands to place your deny blocks. If it's a larger area that you need to cover, You can open the world in Amulet, and use the fill tool to place your deny blocks. 

    Couple of things to note: 

    1. Amulet isn't officially supported in any way (but it is a tool we content builders rely on, so there are a lot of YouTube videos, and I am happy to answer any questions you might have too). 

    2. Backup your Java world before proceeding. Weird things can sometimes happen during the conversion process. 

    3. Always close down Minecraft before using Amulet, but you'll need to open the world in Minecraft Education at least once to be able to locate the files for editing. 

    4. Education is based off of Bedrock, so even if Amulet doesn't reference Education specifically, edits will still work. 

    5. When you place deny blocks in Amulet, unlike other blocks, they won't show up in the editor... however, they will be there when you open the world in Minecraft Education. 

    6. If you have any command blocks in your original Java world, you will need to test them thoroughly in Education. Command syntax can differ significantly between the Java and Bedrock systems. 

    Hope this helps, and let me know how you make out!

    1
  • Ryan Albrey

    Dani Noble and Danny, thank you for your suggestions and information.

    I can see that Amulet is an indispensible tool for some things and I have used it when there was no other way to do what I want to do (such as importing a massive Borobudur map, that I found on a website, into my existing world) but if there is a way to do what I want to do directly in Education version, I rather solve the problem there.

    Does Mojang or Microsoft maintain a repositiory of information about all the valid commands and functions available to Minecraft coders? Where for instance could I find the complete information about how to use the fill command?

    I think the /fill command will solve my problem handsomely, however is there a way to turn this command into the sort of syntax that I can deploy in a javascript code? I wish to write a javascript that can give me even more control over where to place the deny blocks, such as by taking into account the direction that I am facing when determining the coordinates where the blocks should be placed.

    0
  • Moderator Beacon of Knowledge Super Star

    Hi, Ryan Albrey - and welcome!

    I have to admit, I smiled to read about the inventiveness of your students not just (as I deal with) breaking boards, but obscuring them by building in front of them! I hadn't thought of this safeguard; keep the area around the board safe, too! =D

    The fill command is definitely your friend! You will find the best description of it in your game. As you type the command in chat, all of the possible parameters will appear. See the image.

    The most reliable online fan list is probably in this link, but you have to go through a few steps and it includes several versions. The chat commands autopopulate, so you can find commands by typing a letter of the alphabet in chat and seeing what you get. 

    https://www.digminecraft.com/game_commands/index.php

    0
  • HOSHINO HISASHI

    Hi, Ryan Albrey

    It seems to be possible to place a DENY block by JavaScript programming with the blockID specification.

    Please try it.

    player.onChat("0", function () {

        player.say(blocks.nameOfBlock(blocks.blockById(211)))

        blocks.place(blocks.blockById(211), pos(0, 0, 0))

    })
     
    BlockID can also be found by asking the agent to look it up.
    player.say(blocks.nameOfBlock(agent.inspect(AgentInspection.Block, FORWARD)))
     
    Thanks.
     
    0
  • Aleece Landis
    Bug Zapper Beacon of Knowledge Super Star

    So I DO NOT know how to work this sort of thing into java script coding.  I think Debbie Alexander may be far more up on what you can do with the coding but not sure what language she uses most of the time.

    There may be some ways to set up a behavior pack with functions or something to automatically handle running commands as you walk around with a particular tag on your self during setup but that would be a fairly involved tool to create.

    you are probably better off setting a fill command to place Deny blocks at your desired depth around the items you want to protect or under the entire Area you don't want them building/destroying in.
    Like
    /fill ~-10 -64 ~-10 ~10 -64 ~10 deny 0  So you stand right at your board or whatever and you run the command to protect a space that is 20 by 20 from the bottom of the world to the build height.  Or you could place the Y cord at ~-10 if you don't want to protect down to the bottom or want to use the same command in other dimensions.

    You could also set up a repeating command block with a switch in a ticking area with an execute command that will execute on you to fill an area under where ever you walk with your desired blocks and you turn it on and run around the entire area you want to protect.  Then if there are areas you want to allow building you can replace the deny blocks with allow blocks or place allow blocks above the deny blocks ONLY in the building areas.

    You may also decide if you get a good working area that you want to use in other worlds, Save it in a structure block and set up a behavior pack with a structure file to be able to use the structures in whatever worlds you choose.

    0
  • Hello there!

    You can use the immutable world setting instead of using deny blocks.

    Its much easier.

    And you can use the /wb command to let you remove and place things.

    0

Please sign in to leave a comment.