Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3581

Modifying BlockState snapshot inventory overrides name of entity

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • None
    • None

      When i tried to both change contents and display name of chest, i found, that inventory change override name change. Example code:

      Chest chest = (Chest) event.getBlock().getState();
      Inventory blockInventory = chest.getSnapshotInventory();
      blockInventory.clear();
      blockInventory.addItem(new ItemStack(Minecraft.STONE));
      chest.update(true, false);
      chest = (Chest) event.getBlock().getState();
      chest.setCustomName("123");
      chest.update(true, false);
      

      I tried to change order of invocation or event schedule some of this actions on different ticks, but the situations remains the same. Only way to change chest name in this example, is to remove inventory modification.

            Unassigned Unassigned
            angal angal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: