Spawning and Despawning Command Blocks
Hi I'm trying to have a wandering trader spawn in every other day and despawns at night.
I'm testing in a superflat; I have it set up to summon at day via daylight sensor and command block. But I can't get it to despawn at night with an inverted daylight sensor.
The command I'm using: /execute positioned 0 -60 0 run kill @e[type=minecraft:wandering_trader] and then literally just 1 redstone connected to an inverted daylight sensor.
Are the sensors the problem?
Do I need to add a distance= within the brackets?
Would it be better/cleaner to set it up on a tick based timer that repeats? And if so what would the command be for that?
I barely ever use redstone or command blocks so I apologize if this all sounds very juvenile, any help or advice is appreciated!
I'm testing in a superflat; I have it set up to summon at day via daylight sensor and command block. But I can't get it to despawn at night with an inverted daylight sensor.
The command I'm using: /execute positioned 0 -60 0 run kill @e[type=minecraft:wandering_trader] and then literally just 1 redstone connected to an inverted daylight sensor.
Are the sensors the problem?
Do I need to add a distance= within the brackets?
Would it be better/cleaner to set it up on a tick based timer that repeats? And if so what would the command be for that?
I barely ever use redstone or command blocks so I apologize if this all sounds very juvenile, any help or advice is appreciated!
Commentaires
* Downvote this comment if this post is poor quality or does not fit the purpose of r/Minecraft
* Downvote this comment *and report the post* if it breaks the [rules](https://www.reddit.com/r/Minecraft/wiki/rules)
----
(*Vote has already ended*)
Maybe try adding a repeating command block instead of just redstone? Sometimes the signal can be inconsistent. Also make sure the inverted sensor is actually getting powered when you expect it to - they can be finicky in superflat worlds