Get information from the block that was destroyed

Started by 91arrows on

Topic category: Help with modding (Java Edition)

Last seen on 12:31, 22. Jan 2024
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Get information from the block that was destroyed

i added a procedure to the block broken trigger

i want to get information about the block that was broken

however, when i get the block at [x, y, z], it returns as air, because the block was just broken and it's sensing what block is at that position after it is broken

does anyone know a workaround to this

Last seen on 20:10, 10. Dec 2023
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could try cancelling the…
Fri, 06/10/2022 - 01:58

You could try cancelling the event, then checking the pos. After that, try using remove block with particles. I haven't tested this though, so it might not work.

Last seen on 12:31, 22. Jan 2024
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
that would make sense but…
Fri, 06/10/2022 - 15:50

that would make sense but cancelling only works with global triggers

i'm using a trigger from a custom block

i'd rather not use the general block breaking global trigger because that would make it laggy

Last seen on 20:10, 10. Dec 2023
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hmm... You could just go on…
Sat, 06/11/2022 - 15:21

Hmm...

You could just go on ahead and do the global one. As long as you don't explode masses of TNT or something, it should be fine. (Masses of TNT already lag computers so no change there)

If it is too laggy anyways, you could try when a player starts to mine the block, store the block in a variable, then wait a little bit of time. If the block returns as air, you know it has been broken and use the variable as the data.

That might be laggy as well, but it is the best I got for you. Sorry.

I'll let you know if I find a better solution to your problem.

Last seen on 12:31, 22. Jan 2024
Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thank you for the suggestion…
Sat, 06/11/2022 - 18:27

thank you for the suggestion and creative solution

strange that mcreator hasn't addressed this yet