-
Notifications
You must be signed in to change notification settings - Fork 10
Categories
Daniel Saukel edited this page Oct 18, 2020
·
6 revisions
Similiar to the tag system in Vanilla Minecraft, categories group items or mobs together sothat they can easilier be referred to. The most important use case is to set damage modifiers to an item or mob, sothat for example a weapon can be more effective against several mobs than against others.
Categories can be created through scripts.
A_CATEGORY:
- 267 # IRON SWORD
ANOTHER_CATEGORY:
- DIAMOND_SWORD
YET_ANOTHER_CATEGORY:
- golden_sword
- golden_axe
ANOTHER_CATEGORY_THAT_CONTAINS_CUSTOM_ITEMS:
- TEST # A custom item
...and your MobCategories.yml should look similar.
A_CATEGORY:
- 62 # MAGMA CUBE
ANOTHER_CATEGORY:
- GUARDIAN
- MY_CUSTOM_MOB
A damage modifier in an item script may look like this:
...
categoryDamageModifiers:
ANOTHER_CATEGORY: 2.0
String id = "NAME_OF_THE_CATEGORY";
Category<ExItem> items = new Category<>(id);
Category<ExMob> mobs = new Category<>(id);
List<String> serialized = Arrays.asList("IRON_SWORD", "351:4");
Category<ExItem> deserialized = new Category<>(apiInstance, id, serialized);
Wiki: © 2016-2020 Daniel Saukel and contributors, licensed under CC BY-SA