Skip to main content

TagEventJS

Information

This event is fired when a tag collection is loaded, to modify it with script. You can add and remove tags for items, blocks, fluids and entity types.

Parent class

EventJS

Can be cancelled

No

Fields

NameTypeInfo
typeStringTag collection type 

Methods

NameReturn TypeInfo
get(String tag)TagWrapperReturns specific tag container which you can use to add or remove objects to. tag parameter can be something like 'forge:ingots/copper'

TagWrapper class

Fields

NameTypeInfo

Methods

NameReturn TypeInfo
add(String id)TagWrapper (itself)Adds an object to this tag. If string starts with # then it will add all objects from the second tag.
remove(String id)TagWrapper (itself)Removes an object from tag, works the same as add().

Examples