Home Migration Guide Getting Started With Scripts Commands Examples
Generic JSON Recipes

Chemical

This class was added by a mod with mod-id mekanism. So you need to have this mod installed if you want to use this feature.

Importing the class

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

script.zs
import mods.mekanism.api.chemical.Chemical;

A Chemical is the abstract representation of a mekanism chemical substance.

Implemented Interfaces

Chemical implements the following interfaces. That means all methods defined in these interfaces are also available in Chemical

Methods

Gets whether this chemical is the empty instance.

Returns: true if the chemical is the empty instance, false otherwise.

Return Type: boolean

script.zs
// Chemical.isEmptyType() as boolean
myChemical.isEmptyType();

Gets whether this chemical is hidden.

Returns: true if the chemical is hidden, false otherwise.

Return Type: boolean

script.zs
// Chemical.isHidden() as boolean
myChemical.isHidden();

Gets the tags that this chemical is a part of.

Returns: All the tags this chemical is a part of.

Return Type: Set<MCResourceLocation>

script.zs
// Chemical.getTags() as Set<MCResourceLocation>
myChemical.getTags();

Properties

NameTypeHas GetterHas SetterDescription
Name
empty
Type
boolean
Has Getter
true
Has Setter
false
Description
Whether this chemical is the empty type.
Name
hidden
Type
boolean
Has Getter
true
Has Setter
false
Description
Whether this chemical is hidden.
Name
tags
Type
Set<MCResourceLocation>
Has Getter
true
Has Setter
false
Description
Gets the tags that this chemical is a part of.