Hi 'crafters!
I'm trying to modify a better beds command module that will detect when there is a thunderstorm and prevent players from sleeping. I'm planning a charged creeper farm, so I want to maximise the amount of thunder time we get. Is there a way that I can detect thunderstorms to get an output? I've seen plenty of methods to detect rain, but none for thunderstorms.
CommandBlockGuy: The problem with daylight detectors is that light levels in rain & thunder weather overlap, so the detector isn't capable of detecting thunder specifically.
Cubes: This idea has crossed my mind, but using it to deactivate sleeping would be ineffective as the appearance of thunder is random, so I can't even use a testfor and cooldown timer to prevent sleeping. It'd either fail to prevent sleeping throughout the thunderstorm, or prevent sleeping in normal weather if a bolt happens to strike at the end of the storm.
With command blocks, you can't exactly detect storms, but you can test for Lightning Bolts, which are actually entities.
LightningBolts are not savegame entities and therefore cannot be tested for. They simply have a special clause with the /summon command, in that if "LightningBolt" is the direct input ID (as opposed to doing a table lookup for all other cases), it will ignore dataTags and create the lightning bolt.
As what Skyliner said, LightningBolt are what I call "fake entities", they exist in the summon command, but the game doesn't reconize it as an entity. (The entity counter in F3 debug will count up for visible entites, but the total entity count doesn't count up. So they can't really be targeted.)
The Meaning of Life, the Universe, and Everything.
Join Date:
8/13/2015
Posts:
88
Location:
A Place Where: e^(i*pi)≠-1
Minecraft:
PuggleWebster
Member Details
Is "LightningBolt" the only entity that you call a "fake entity"? I can't think of any others that aren't able to be targeted with /testfor or other commands.
Rollback Post to RevisionRollBack
A Person Who Is Attempting To Become More Advanced In The Field Of Command Block Knowledge
Command Block, Be My Mirror, My Sword And My Shield.
Hi 'crafters!
I'm trying to modify a better beds command module that will detect when there is a thunderstorm and prevent players from sleeping. I'm planning a charged creeper farm, so I want to maximise the amount of thunder time we get. Is there a way that I can detect thunderstorms to get an output? I've seen plenty of methods to detect rain, but none for thunderstorms.
Cheers,
-Cookiehook
Check out my Youtube channel, where I build a theme park in vanilla Minecraft!
https://www.youtube.com/playlist?list=PLeCiIIOoWhe-mq3nYd_nXXrKw9MkjnUU7
As far as I know, there is know way to do this with command blocks.
However, daylight sensors can detect weather.
There is a chart for power levels in weather conditions at the Minecraft Wiki.
http://minecraft.gamepedia.com/Daylight_Sensor
With command blocks, you can't exactly detect storms, but you can test for Lightning Bolts, which are actually entities.
Eccccccccccccccccccccccccccccccccccccccccc
CommandBlockGuy: The problem with daylight detectors is that light levels in rain & thunder weather overlap, so the detector isn't capable of detecting thunder specifically.
Cubes: This idea has crossed my mind, but using it to deactivate sleeping would be ineffective as the appearance of thunder is random, so I can't even use a testfor and cooldown timer to prevent sleeping. It'd either fail to prevent sleeping throughout the thunderstorm, or prevent sleeping in normal weather if a bolt happens to strike at the end of the storm.
Thanks for the input from both of you
Check out my Youtube channel, where I build a theme park in vanilla Minecraft!
https://www.youtube.com/playlist?list=PLeCiIIOoWhe-mq3nYd_nXXrKw9MkjnUU7
LightningBolts are not savegame entities and therefore cannot be tested for. They simply have a special clause with the /summon command, in that if "LightningBolt" is the direct input ID (as opposed to doing a table lookup for all other cases), it will ignore dataTags and create the lightning bolt.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Technically couldn't you run a very fast redstone clock into a command block "/testfor @e[type=LightningBolt]" ?
Shouldn't it say in chat "Found LightningBolt" exactly when it strikes?
(Don't quote me on this)
As what Skyliner said, LightningBolt are what I call "fake entities", they exist in the summon command, but the game doesn't reconize it as an entity. (The entity counter in F3 debug will count up for visible entites, but the total entity count doesn't count up. So they can't really be targeted.)
Mewtwo is the best pokemon!
Is "LightningBolt" the only entity that you call a "fake entity"? I can't think of any others that aren't able to be targeted with /testfor or other commands.