how to detect when a plugin calls Block#setType() or setTypeId, etc

Discussion in 'Plugin Development' started by reghzyTheR, Jun 1, 2021.

Thread Status:
Not open for further replies.
  1. Offline


    if i call the Block#setType or setTypeId or any method like that, is it possible to detect (via an event maybe) when that method is called?

    the only other alternative i have is to simply just check if that block's type is air (or an ID that was unexpected), but that would require registering a scheduler which is just more work tbh

    maybe like some sort of BlockChangedEvent
  2. Offline


    davidclue and reghzyTheR like this.
  3. Offline


    i just found out that calclaviacore (one of mods on my server) transformed the chunk class and injected their own event (ChunkSetBlockEvent) event in the setBlockIDWithMetadata method, so i can just import the mod into my plugin, register a listener for forge's event bus and just listen to those events :)
  4. Online

    timtower Administrator Administrator Moderator

    Modded servers are not supported by Bukkit
Thread Status:
Not open for further replies.

Share This Page