1.15.2 Allow Mob Through Blocks

Discussion in 'Spigot Plugin Development' started by WhenTake, Jan 17, 2020.

  1. I want to allow any mob to pass through certain blocks but not players themselves.

    From what I understand, I would have to
    1. Set the blocks I want mobs to pass through to air
    2. sendBlockChange every single block that I want mobs to pass through to a block
    3. Do sendBlockChange every time that a chunk reloads
    4. Intercept all packets when the player interacts with one of the blocks


    Is there any easier way to implement this?
     
  2. Do you want to allow them to go through a certain type of block or is it applied for some specific areas?
     
  3. I could do either option.
     
  4. If you want only certain areas to be passable by mobs then fake blocks via packets is the way to go.
    Write some fake block API that handles all the packets and you are good to go. Just store the fake block data with your chunks together and load them. Then handle the incomming/outgoing packits for those Blocks. (as you already know).
    If you use ProtocolLib this should not be too hard.