#Activating redstone: what is the most acceptable method people use?

1 messages · Page 1 of 1 (latest)

radiant vapor
#

I have recently added features to a datapack that powers redstone, but i implemented it in a way i am not satisfied with: turning redstone wires into redstone blocks and back again, via setblock. I have not played with other developers' datapacks before so i am unfamiliar with the methods they use to power redstone, but i am assuming they have better ways i am unfamiliar with, just due to the sheer bad-ness of using redstone blocks and setblock. i'd be suprised if this was really the best way. So i'd like to ask what way other datapack developers actually tend to use, so i can hopefully update my pack with a better way.

i thought setting the powered parameter on repeaters would work but it doesnt seem to, nor setting that on wires or comparators.

i'm hoping to support minecraft 26.1.1 and higher.

my end goal is to just power redstone wires and stuff without relying on a method that can accidentally mess up player builds.

tall kelp
#

I would find a way to figure out how to summon a marker with the tag "power_marker" where you need the power to start, then do execute at @n[type=marker, tag=power_marker] run setblock ~ ~ ~ redstone_wire[power:x]

radiant vapor
#

setting the wire power level didn't work when i tried it without marker entities. it just immediately turns off again because of block updates to the neighboring wires propagating right back, even when doing this in a tick function. i guess i can try again though with marker entities specifically.

#

i'll update this thread or close it according to how that works out

keen mica
#

I don't know if there's a cleaner/easier way, but you can place powered wires in strict mode so that it doesn't immediately update the wire you place

#

And then if you do it for the wires around that recursively (which should be annoying to do) until you reach terminal wires for which you can send block updates it should work

#

also I don't think powering up redstone wires is something data pack devs commonly have to do and I doubt there's an idiomatic way

dusky mulch
#

Yeah, that's not really a thing in datapacks. Even tbe above mentioned methods gave big flaws. Tge main issues are block updates turning the wires off again. That means you would need to recusively replace all wires connectex fo each other every tick which is just not possible as it causes way too much lag.

I solved this issue back then with my custom block actually being a locked barrel. I then changed the amount of items inside accordingly so the player can read the signal with a comparator.

radiant vapor
#

ah ok...this feedback is more in line with what i was kindof looking for. guess i can just keep my datapack as-is since its a problem that cant be solved in a better way. my datapack allows lecterns to be used for minecart track routing, and they do that by powering redstone since changing the switch track directly isnt ideal for my goals of player customizability and stuff. i'll close this question now.