Completely prevent a physics update

Discussion in 'Spigot Plugin Development' started by Petersoj, Jun 9, 2017.

  1. Is there a way to completely prevent a physics update when placing or setting a block? I know that the blockstate.update() method will prevent a physics update on surrounding blocks, but the actual block itself will be checked and updated. I tried to use BlockPhysicsEvent, but this only gets triggered for surrounding blocks as well.
    So, for example, I want to place a torch (or some other block) that will not break into a tile item entity if there is no adjacent block. So it will just be floating in mid-air.

    So I just want a way to prevent the checking of adjacent blocks when placing certain blocks, but I still want everything else to be updated. (lighting updates, etc.)

    Let me know if I am obviously missing something, or you can come up with an NMS alternative.
    #1 Petersoj, Jun 9, 2017
    Last edited: Jun 9, 2017
  2. Set the block with NMS or FAWE in a way that does not do any updates.
  3. What is FAWE? And how might I go about setting the block via NMS without triggering a physics update? I have dug through some code and found that I would have to create my own custom block for every block that breaks, when placed, without an adjacent block.
  4. Yeah, I looked at that method, but it turns out that blockstate.update() calls that exact method and I am using blockstate.update()
    • Agree Agree x 1
  5. NMS has methods for setting a block without doing any updates, they are used internally by the methods that place and update. I am not sure where a custom block got involved or what it is meant to do.

    FAWE is FastAsyncWorldEdit, and i believe WorldEdit can do it by itself.
  6. Okay thanks. I'll look through some code.