1.15.2 Force TileEntity visual updates to Client

Discussion in 'Spigot Plugin Development' started by DoubleJGames, Jan 29, 2020.

  1. Hello,

    I am implementing some custom blocks into a plugin I am working on. I am using the mob spawner block model trick to simulate blocks as tile entities. The actual functionality is very simple and is all working. (Detect the player placing a custom block, replace the spawner with a custom spawner)

    Here is an overview on how the custom blocks display


    The issue I am having is a visual glitch. When the spawner is placed down (onPlaceEvent) its data is changed so it contains an armorstand as the mob with an item on its head. The player radius for the spawner is also set to 0. This means the entity inside the spawner no longer spins and is stuck in place. However, the entity displayed in the spawner sometimes rotates slighty, which means the model is no longer in the correct place. The issue is on the client side, as if the client unloads the chunks (by leaving and coming back or relogging) the glitch is fixed and all the entities displayed in the spawner are in the correct position. My guess is I need to force an update to the client regarding the block but I am stuck in doing this and have not found anything that works.

    Any insights would be appreciated.
     
  2. Chunk loading is server-side, you can force the server to load again that chunk.
    World class contains loadChunk or something like that
     
  3. There is a block update packet, Perhaps someone with more knowledge of packets can help...