This mod is an API that provides useful extensions to existing vanilla classes. They are grouped based on the class that is primarily dealt with or returned by the function.
Block.makeItem() - creates a new BlockItem based on the block. Optionally takes an Item.Settings.Block.matches(Identifier) - checks whether the block is contained in the tag with the given idBlock.matches(String) - converts the String to an Identifier then calls matches(Identifier)String.id - converts the String to an IdentifierPair.id - converts the Pair to an IdentifierIdentifier.component1() and .component2() - allows for destructuring of IdentifiersString.validId() - checks if the String is a valid IdentifierPair.validId() checks if the Pair is a valid IdentifierItem.stack() - creates a new ItemStack with the Item. Optionally takes an Int for the count.Item.matches(Tag or Identifier or String) - checks if the Item is in the Tag. Same idea as Block::matchescompooundTag(vararg Pair) - creates a new CompoundTag with the given elementsCompoundTag.set(String, Tag) - operator for CompoundTag::putMap.toCompoundTag() - creates a new CompoundTag from the map's elementsAny?.toTag() - Creates a new Tag from the object. Note: if the object cannot be converted into a tag, this will crash the game.interface NBTSerializable - Allows you to create the NBT representation for your classes.
Not needed for Entity and BlockEntity subclasses.Registry.get(String) - converts to an Identifier and gets the value in the RegistryRegistry.set(Identifier or String, T) - Registers the value in the Registry using Registry.registerIdentifier.item() and .block() and .entityType() and .blockEntityType() and .registry() - gets the value
at the Identifier in the appropriate RegistryIdentifier.tag() - gets a Tag at the Identifier. Only valid for Item, Block, EntityType, and Fluid.
Any other type will crash the game.String.tag() - converts to an Identifier and gets the Tag at itTag.isEqual(Tag) - Tag.equals is not properly overridden. Use this to compare equality with tags.World.runOnClient(()-Unit) - Runs the passed function only on the clientWorld.runOnServer(()-Unit) - Runs the passed function only on the serverNo files available for download.