PARTICIPANT IN A FINALISTS JAM
This Blog is an entry in the completed "Minedeas 2" - Blog Contest #10.

Minecraft Blogs / Article

Adding New Command Block Selectors: "And" and "Or"

  • 491 views, 1 today
  • 3
  • 1
  • 2
Lectrosaurus's Avatar Lectrosaurus
Level 7 : Apprentice Mage
1
I do not know how many people who read this know a lot about command blocks, but I have been scouring the internet for the answer to my problem, and it appears the solution is not even in minecraft. This is a rather small, and possible unnoticed thing about command blocks, let me give you and idea of what I am talking about.

I want to have a /summon command and have it summon a evocation fangs under all entities in the area besides Players and Items.
I can easily do
/execute @e[tag=(mytaggoeshere)] ~ ~ ~ execute @e[type=!Player,r=5] ~ ~ ~ /summon evocation_fangs
But this makes the fang spawn underneath items, too.
I can do
/execute @e[tag=(mytaggoeshere)] ~ ~ ~ execute @e[type=!Item,r=5] ~ ~ ~ /summon evocation_fangs
But this makes the fang spawn underneath players.
I have tried to do
/execute @e[tag=(mytaggoeshere)] ~ ~ ~ execute @e[type=!Player,type=!Item,r=5] ~ ~ ~ /summon evocation_fangs
But it only regards the last one, and summons fangs under the player.
I could have two command blocks, both doing the same thing but switching out !Player for !Item, but they would cancel each other out and fangs would be summoned beneath both items and players, along with all other entities in the area.

I propose that Mojang add an "And" or "Or" selector specification, so that one would be able to make this work and have it look like.
/execute @e[tag=(mytaggoeshere)] ~ ~ ~ execute @e[type=!{Player,Item},r=5] ~ ~ ~ /summon evocation_fangs
or something. That would cause it to work and for fangs to be summoned under all entities in the area except players and items.

This is just one example of how the "and" selector specification could help command blocks function in a wider spectrum.
Tags

Create an account or sign in to comment.

Enertoutpuissant
08/10/2017 3:00 pm
Level 42 : Master Architect
Enertoutpuissant's Avatar
You can maybe add a tag to fangs that are r=2 from the player and kill them :/ I think that could work
1
Pika Punch
08/06/2017 12:46 am
Level 17 : Journeyman Network
Pika Punch's Avatar
I definetly agree. This could shorten the use of redstone in command blocks and make it so much easier and faster to do a bunch of commands at once. It can also make it more specific. But they should also add variables like (If not, And/or, If true, etc.). You deserve a diamond my good friend.
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome