#Checking if a block is powered

1 messages · Page 1 of 1 (latest)

mighty sedge
#

Is it possible to check if a block is powered? I know it's possible to see if a redstone wire for example, has a certain power lever using something like:
/execute if block x y z minecraft:redstone_wire[power=1]
For something like white wool however, since this is not a redstone component that can have a certain power level, the [power=x] isn't something I can check for. I was wondering if there is some other way of discovering if a block is powered.

Ultimatly I'd like to make a datapack that can check if a block is considered either 'hard powered', 'soft powered' or 'not powered'.
Thx already!

jade canopy
#

Not really, without checking all adjacent blocks for redstone components

#

You could make a complicated predicate for that

mighty sedge
#

Hm, okay.. Ig I'll try my hand at that then. Thx

mighty sedge
# jade canopy Not really, without checking all adjacent blocks for redstone components

Do you know if maybe there's an easier way to check for these conditions?
Because with redstone wires for example, you'd need it to face the correct way and also be powered. To check for all of these cases individually feels clumsy, but I can't think of an easier way. I know it's possible to use /execute unless, but you'd need to use that in combination with an /execute if x y x redstone_wire, for example. Even then it seems like a lot... I don't have a lot of experience making datapacks yet, so I'm not sure how well you could use !=, or, and, and such... From what I know so far it seems hard.

jade canopy
#

You can do that all with a predicate, but yes it's going to be complicated. There's not an easier way

#

This isn't something data packs are necessarily good at

mighty sedge
quick bay
#

not an easy feat, you will also have to verify the facing of the wire and what not

fiery monolith
#

Tip if you know a bit of java you can actually look at minecraft's source code and check how it does it