Como detecto redstone? - How do I detect redstone?

Discussion in 'Spigot Plugin Development' started by colo13, Oct 1, 2019.

  1. Tengo un problema con la redstone, como puedo obtener atravez de codigo que se activo una redstone?


    I have a problem with the redstone, how can I get through code that a redstone is activated?
     
  2. You're looking for the BlockRedstoneEvent. Just be aware, that this event gets called A LOT, due to the nature of Redstone block updates.
     
    • Like Like x 1
    • Agree Agree x 1
  3. Where is "A LOT"?
     
  4. "A lot" means the same as much/many/lots of.
     
  5. Que me quieren decir con "muchos"?
     
  6. Please talk english, this is an english forum.
     
    • Like Like x 1
    • Agree Agree x 1
  7. What do you mean by "A LOT"?
     
  8. Use a translator?
    This is your solution. But as @Gadse already said, the BlockRedstoneEvent gets called very often. So if you do heavy things on it, you could create lag.
     
    #8 patri9ck, Oct 2, 2019
    Last edited: Oct 2, 2019
  9. Ok, how do I detect when redstone is activated? I did not find it. :/?
     
  10. I find it hard to understand: https://hub.spigotmc.org/javadocs
     
  11. It depends of you want to do, do you want to know if a redstone block is currently activated from anywhere of your code ? Then you can't use an Event, if you want to know when a redstone block is activaed then use a Event.

    Depende de lo que quieras hacer, digamos que creas un comando y quieres saber si un bloque de redstone esta activado, entonces no te sirve el evento, el evento se llama cuando el bloque se activa, pero no puedes acceder a este desde el comando, para eso seguramente tengas que castear el BlockState o BlockDate del bloque a una clase de redstone. Igualmente tienes que decirnos que es lo que quieres hacer para que te podamos ayudar bien.
     
  12. I need to detect when redstone or tester, or repeater is activated.

    Necesito detectar cuando se activa redstone o comprobador, o repetidor.
     
  13. si detecta todos, que is tu code
     
  14. Los repetidores no detectan.

    Te paso codigo?