Class TagUtils

java.lang.Object
fr.pacdu.pacpackquests.util.TagUtils

public class TagUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static List<net.minecraft.world.item.Item>
    getAllItemsInTag(net.minecraft.resources.ResourceLocation tagId)
    Gets ALL items associated with a tag ResourceLocation.
    static net.minecraft.world.level.block.Block
    getFirstBlockInTag(net.minecraft.resources.ResourceLocation tagId)
    Gets the first block associated with a tag ResourceLocation.
    static net.minecraft.world.entity.EntityType<?>
    getFirstEntityTypeInTag(net.minecraft.resources.ResourceLocation tagId)
    Gets the first entity associated with a tag ResourceLocation.
    static net.minecraft.world.item.Item
    getFirstItemInTag(net.minecraft.resources.ResourceLocation tagId)
    Gets the first item associated with a tag ResourceLocation.

    Methods inherited from class java.lang.Object

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

    • TagUtils

      public TagUtils()
  • Method Details

    • getFirstItemInTag

      public static net.minecraft.world.item.Item getFirstItemInTag(net.minecraft.resources.ResourceLocation tagId)
      Gets the first item associated with a tag ResourceLocation. Perfect for getting a display icon for a UI.
      Parameters:
      tagId - the ResourceLocation of the tag.
      Returns:
      the first Item in the tag list.
    • getFirstBlockInTag

      public static net.minecraft.world.level.block.Block getFirstBlockInTag(net.minecraft.resources.ResourceLocation tagId)
      Gets the first block associated with a tag ResourceLocation. Perfect for getting a display icon for a UI.
      Parameters:
      tagId - the ResourceLocation of the tag.
      Returns:
      the first Block in the tag list.
    • getFirstEntityTypeInTag

      public static net.minecraft.world.entity.EntityType<?> getFirstEntityTypeInTag(net.minecraft.resources.ResourceLocation tagId)
      Gets the first entity associated with a tag ResourceLocation. Perfect for getting a display icon for a UI.
      Parameters:
      tagId - the ResourceLocation of the tag.
      Returns:
      the first Entity in the tag list.
    • getAllItemsInTag

      public static List<net.minecraft.world.item.Item> getAllItemsInTag(net.minecraft.resources.ResourceLocation tagId)
      Gets ALL items associated with a tag ResourceLocation. Useful if you want to make the icon cycle through all possibilities.
      Parameters:
      tagId - the ResourceLocation of the tag.
      Returns:
      a List of all the items in the tag.