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

Spigot's entity activation inactiveTick invokes the AI for NoAI villagers

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • This server is running CraftBukkit version git-Spigot-798ea6a-44d675a (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)
    • Yes

      Example plugin code: https://pastebin.com/3HGz5xhz

      When clicking a block with a carrot, this spawns a NoAI villager with farmer profession. The villager will however lose its profession shortly after being spawned, due to Spigot's entity activation feature occasionally skipping ticking of supposedly active entities (every 4 ticks) and then instead calls the entity's inactiveTick function. For Villagers this will however call mobTick, which performs mob AI related tasks, even if the villager has the NoAI flag set.

      The linked source code contains some additional details on the preconditions for this issue to occur.

      Possible solution: Check the mob's NoAI flag before calling mobTick during the villager's inactive tick.

            Unassigned Unassigned
            blablubbabc blablubbabc
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: