Class VillagerInteractionRegistries

java.lang.Object
net.fabricmc.fabric.api.registry.VillagerInteractionRegistries

public final class VillagerInteractionRegistries extends Object
Registries for modifying villager interactions that villagers have with the world.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    registerCompostable(net.minecraft.world.level.ItemLike item)
    Registers an item to be used in a composter by farmer villagers.
    static void
    registerFood(net.minecraft.world.level.ItemLike item, int foodValue)
    Registers an item to be edible by villagers.
    static void
    registerGatherableItem(net.minecraft.world.level.ItemLike item)
    Deprecated.
    Add items to the minecraft:villager_picks_up item tag instead.
    static void
    registerGiftLootTable(net.minecraft.resources.ResourceKey<net.minecraft.world.entity.npc.villager.VillagerProfession> profession, net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> lootTable)
    Registers a hero of the village gifts loot table to a profession.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • registerGatherableItem

      @Deprecated public static void registerGatherableItem(net.minecraft.world.level.ItemLike item)
      Deprecated.
      Add items to the minecraft:villager_picks_up item tag instead.
      Registers an item to be collectable (picked up from item entity) by any profession villagers.
      Parameters:
      item - the item to register
    • registerCompostable

      public static void registerCompostable(net.minecraft.world.level.ItemLike item)
      Registers an item to be used in a composter by farmer villagers.
      Parameters:
      item - the item to register
    • registerFood

      public static void registerFood(net.minecraft.world.level.ItemLike item, int foodValue)
      Registers an item to be edible by villagers.
      Parameters:
      item - the item to register
      foodValue - the amount of breeding power the item has (1 = normal food item, 4 = bread)
    • registerGiftLootTable

      public static void registerGiftLootTable(net.minecraft.resources.ResourceKey<net.minecraft.world.entity.npc.villager.VillagerProfession> profession, net.minecraft.resources.ResourceKey<net.minecraft.world.level.storage.loot.LootTable> lootTable)
      Registers a hero of the village gifts loot table to a profession.
      Parameters:
      profession - the profession to modify
      lootTable - the loot table to associate with the profession