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.Identifier tagId) Gets ALL items associated with a tag Identifier.static net.minecraft.world.level.block.BlockgetFirstBlockInTag(net.minecraft.resources.Identifier tagId) Gets the first block associated with a tag Identifier.static net.minecraft.world.entity.EntityType<?> getFirstEntityTypeInTag(net.minecraft.resources.Identifier tagId) Gets the first entity associated with a tag Identifier.static net.minecraft.world.item.ItemgetFirstItemInTag(net.minecraft.resources.Identifier tagId) Gets the first item associated with a tag Identifier.
-
Constructor Details
-
TagUtils
public TagUtils()
-
-
Method Details
-
getFirstItemInTag
public static net.minecraft.world.item.Item getFirstItemInTag(net.minecraft.resources.Identifier tagId) Gets the first item associated with a tag Identifier. Perfect for getting a display icon for a UI.- Parameters:
tagId- the Identifier of the tag.- Returns:
- the first Item in the tag list.
-
getFirstBlockInTag
public static net.minecraft.world.level.block.Block getFirstBlockInTag(net.minecraft.resources.Identifier tagId) Gets the first block associated with a tag Identifier. Perfect for getting a display icon for a UI.- Parameters:
tagId- the Identifier of the tag.- Returns:
- the first Block in the tag list.
-
getFirstEntityTypeInTag
public static net.minecraft.world.entity.EntityType<?> getFirstEntityTypeInTag(net.minecraft.resources.Identifier tagId) Gets the first entity associated with a tag Identifier. Perfect for getting a display icon for a UI.- Parameters:
tagId- the Identifier of the tag.- Returns:
- the first Entity in the tag list.
-
getAllItemsInTag
public static List<net.minecraft.world.item.Item> getAllItemsInTag(net.minecraft.resources.Identifier tagId) Gets ALL items associated with a tag Identifier. Useful if you want to make the icon cycle through all possibilities.- Parameters:
tagId- the Identifier of the tag.- Returns:
- a List of all the items in the tag.
-