Solved Player.sendBlockChange() that isn't deprecated?

Discussion in 'Spigot Plugin Development' started by GamingMeatheadHD, Sep 12, 2018.

  1. Hey there!

    I'm wanting to send a block change to a client but it seems like the only thing I'm finding is the deprecated "#Player.sendBlockChange()" method. Do you know if there's any functionality for this that isn't deprecated, or should I just use the old method/NMS?

    Thanks!
     
  2. Oh okay! BlockData must be a new thing I haven't seen yet. Now trying to use it, I'm noticing I can't instantiate BlockData because it's an interface. So if I just wanted to change the material, would you happen to know how that works off the top of your head using BlockData?

    I appreciate the help!
     
  3. Senmori

    Senmori Retired Resource Staff
    Retired Patron

    use
    Code (Java):
    Material.<Material>.createBlockData()
    If you wanted to specify some data on the BlockData there is
    Code (Java):
    Material.<Material>.createBlockData(Consumer<BlockData>)
     
  4. Much appreciated! Thank you!