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

EntityBreedEvent getBreeder() inaccuracy

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • git-Bukkit-dc69d2b (MC: 1.13.1) (Implementing API version 1.13.1-R0.1-SNAPSHOT)
    • Yes

      The EntityBreedEvent has a method:

      • getBreeder(): LivingEntity

      BUT that is not the whole story right? 

      What happens if I feed a horse and another player does?

      You don't always have one or none breeders but sometimes two ....

      (You also have two ItemStacks then sometimes as  getBredWith():ItemStack suggests)

      Since Minecraft 1.12.2 the game has the NBTTags LoveCauseLeast and LoveCauseMost that save the lower and upper bits of the uuid of the player that put the horse in love-mode last, so it is possible to work around the API here by getting those tags from the parents with a reflector but that's not ideal :/

      One could add multi entity support by 

      • getBreeders(): Set<LivingEntity> 

      Null or isEmpty when the breeder(s) are/is null and just a 'list' of the breeders

      Either that or something like

      • getSecondaryBreeder(): LivingEntity

      I'd really appreciate something like that, I don't exactly have the time to contribute this to the API myself :/

       

      If you want a code example just hit me up, I didn't feel like hacking one together because it seems rather clear without it

            Unassigned Unassigned
            RSTJulia Julia Fox
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: