Class TeamEnchantment
- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructorsConstructorDescriptionTeamEnchantment(TeamEnchantment.Target target, Enchantment ench, int lvl) TeamEnchantment(Predicate<ItemStack> targetPredicate, String targetId, Enchantment ench, int lvl) You generally should useTeamEnchantment(Target, Enchantment, int)instead.
- 
Method SummaryModifier and TypeMethodDescriptionGet the enchantment that shall be applied on the items.intgetLevel()Get the level of the enchantment that gets appliedGet the broad item target this enchantment should target.Get the id of the target.booleanGet whether this enchantment is applicable to the given material.
- 
Constructor Details- 
TeamEnchantment- Parameters:
- target- The item type it should target
- ench- The enchantment
- lvl- The level of the enchantment
 
- 
TeamEnchantmentpublic TeamEnchantment(Predicate<ItemStack> targetPredicate, String targetId, Enchantment ench, int lvl) You generally should use TeamEnchantment(Target, Enchantment, int)instead. This constructor, however, allows you to be more precise with the items that should be enchanted.The targetPredicate should always return the same result for the same material. If it does not, then unexpected behavior might occur. - Parameters:
- targetPredicate- The predicate that determines if an item should be enchanted
- targetId- The id of the target. Multiple enchantments with the same targetId will be combined into one
- ench- The enchantment
- lvl- The level of the enchantment
 
 
- 
- 
Method Details- 
getTargetGet the broad item target this enchantment should target.- Returns:
- The items for which the enchantment gets applied on
 
- 
isApplicableGet whether this enchantment is applicable to the given material.E.g. if the target is TeamEnchantment.Target.PICKAXEand the material isMaterial.DIAMOND_PICKAXE, this method would returntrue. If the material would however beMaterial.DIRT, this method would returnfalse.- Parameters:
- is- The item to test
- Returns:
- trueif the enchantment is applicable,- falseotherwise
 
- 
getTargetIdGet the id of the target.If a player buys an enchantment with the same targetId multiple times, then the older one with the equal targetId will be replaced by the newer one. Built-in targets (those that are not TeamEnchantment.Target.CUSTOM) will returnEnum.name().- Returns:
- The id of the target
 
- 
getEnchantmentGet the enchantment that shall be applied on the items.- Returns:
- The enchantment that gets applied
 
- 
getLevelpublic int getLevel()Get the level of the enchantment that gets applied- Returns:
- The level of the enchantment that gets applied
 
 
-