Solved How can I replace special block like chest to diamond_block

Discussion in 'Spigot Plugin Development' started by TangJin, Jul 31, 2021.

Thread Status:
Not open for further replies.
  1. I am trying to use protocollib,but it too hard to me,I tried use MAP_CHUNK event listener
    but I dont know where is blockdata and I cant understand what is bytedata for,
    anyone can help me?
    Thanks
     
  2. Do you want to change it per player or for everyone?
    If you want to change it for everyone just use Block#setType method.
     
  3. only change one bro,
    I want do is when chunk load change,
    but sendBlockChange //mspt high
    and MutliBlockChange //I don't know how to use and it not good,I want do change block when send chunk.
     
  4. Listen to ChunkLoadEvent and Player#sendBlockChange?
     
  5. I already do that,but mspt very very high,
    only one player change mspt = 29.
    what if many player?
     
  6. I can sure not other code let mspt high
     
  7. It'll be harder to do it with protocollib since it requires a block id which is obtainable with nms Block#getCombinedId
     
  8. yes,I know,but it my only choose,
    other method will use 2x performance and let mspt high.
     
    • Agree Agree x 1
  9. if you know how to let it can use in 1.16.5
    please add my discord: TJServer#6370

    if you dont know clearly,we can try fix together.
    thanks for help
     
  10. but this thread will not be closed,because I still need solve the problem.
     
  11. hmm
    I think use my second way is use mutliblockchange,
    this is why I dont want send another packet,I want change packet

    send another packet:
    chunk already loaded(packet 1)
    edit all blocks(packet 2)

    change packet:
    chunk load with changed packet(packet only one and faster)
     
  12. but I am not clearly how to use mutliblockchangepacket
    who can help?
     
    • Agree Agree x 1
  13. Solve,thank everyone
     
Thread Status:
Not open for further replies.