Forumskeyboard_arrow_right Help keyboard_arrow_right Java Edition

Create Forum Thread
1

Can anyone help me to fix this command?

1 emeralds3 replies80 views
created 08/12/2019 2:36 pm by Overlord_Decca history
last reply 08/14/2019 6:14 am
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 avatar
Overlord_Decca
Level 1 : New Explorer
0

comment Login or register to post a reply.

3 replies

2
08/13/2019 4:31 am
Level 8 : Apprentice Modder
HoboMaggot
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
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 8 : Apprentice Modder
HoboMaggot
This is only true for fill commands that have replace after the block it fills out.

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome