Minecraft testforblock command problem

Minecraft testforblock command problem - Worried Women Talking at Home

I need help specifying a command! Right now I have the following command:

/testforblock -565 18 -1357 chest 3 {Items:[{id:sapling}]} 

How can I specify the sapling to a dark oak sapling? Also once it found the sapling how can I remove only 1 sapling from the chest?



Best Answer

Saplings use the Damage tag to store their type. Dark Oak's value is 5 and Damage is a short type, hence the s.

This command should test for a dark oak sapling in the chest.

/testforblock -565 18 -1357 chest 3 {Items:[{id:"sapling", Damage:5s}]}



Pictures about "Minecraft testforblock command problem"

Minecraft testforblock command problem - Woman Comforting and Supporting Friend
Minecraft testforblock command problem - A Sad Woman Sitting on Bed Between Women
Minecraft testforblock command problem - Woman in Black Blazer Standing Beside Woman in Black Blazer



Why is my command block in Minecraft not working?

You may find that the commands you are trying to have the command block execute are not working. This may be due to the certain limitations the block has on what commands it can run successfully. Command Blocks will execute commands with an OP level 2 permissions.

How do you do the unkillable command in Minecraft?

If you need to do something extremely dangerous but don't want to die then just do /invincible command for let's say 100 minutes so you type in the command and boom your invincible for 100 minutes .



How to Use Test For And TestForBlock Command In Minecraft




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Karolina Grabowska, Karolina Grabowska, RODNAE Productions, cottonbro