1

Can anyone help me to fix this command?

Overlord_Decca's Avatar Overlord_Decca8/12/19 2:36 pm history
1 emeralds 263 3
8/14/2019 6:14 am
HoboMaggot's Avatar HoboMaggot
To keep it short and simple: I'm making a lamp puzzle, and I want one of the buttons to turn one of the lamps off if a specific other lamp is off. The lamps are controlled by which block is behind them - air or a redstone block.

I've been looking on the Minecraft wiki etc for commands, and I'm trying to use the Execute if block command. The command I am using is:

execute if block -7313 52 -6370 minecraft:air run fill -7315 52 -6370 -7315 52 -6370 minecraft:air replace

From what I read on the wiki, and as far as I can tell, this command should be working. When the button is pressed, Block A (coordinates -7315 52 -6370) should become an air block if Block B (coordinates -7313 52 -6370) is an air block. However, when I run the command by pressing the button, absolutely nothing happens. The command block output is nothing, and Block A never changes, regardless of whether Block B is an air block or a redstone block.

To clarify; Block A should become an air block if Block B is an air block. Instead, absolutely nothing happens regardless of what Block B is. No output or anything.

-Yes, the coordinates for Block A and Block B are correct. I've checked them several times myself and had someone else look, too.

-There is no error message in the command feed. Nothing happens at all. It doesn't even say 'No blocks were filled' or anything like that.


-The command block is definitely receiving redstone power. This was my first thought but the repeater into it is definitely activating when the button is pressed.

I hope I've included enough information (and excess, it feels like) that someone will be able to help me figure out what isn't working, and hopefully figure out how to make it work.

Any help will be appreciated.
~Dani
Posted by Overlord_Decca's Avatar
Overlord_Decca
Level 1 : New Explorer
0

Create an account or sign in to comment.

3

2
08/13/2019 4:31 am
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
Unlike setblock, the final replace in /fill needs to have a block to replace like dirt/wood.
Basically the command failed because you haven't filled out what you need to replace.

execute if block -7313 52 -6370 minecraft:air run fill -7315 52 -6370 -7315 52 -6370 minecraft:air replace dirt
1
08/13/2019 8:47 am
Level 1 : New Explorer
Overlord_Decca
Overlord_Decca's Avatar
Hello, HoboMaggot;

Thank you for the help - fixed the issue immediately. Just another quick question: is this true for all fill commands? Because I've used multiple systems like this before (without this particular complication) where the replace option alone, with no specific block to replace, has worked perfectly.
1
08/14/2019 6:14 am
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
This is only true for fill commands that have replace after the block it fills out.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome