Package fr.pacdu.pacpackquests.util
Class TagUtils
java.lang.Object
fr.pacdu.pacpackquests.util.TagUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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.BlockgetFirstBlockInTag(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.ItemgetFirstItemInTag(net.minecraft.resources.ResourceLocation tagId) Gets the first item associated with a tag ResourceLocation.
-
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.
-