Last active
November 11, 2018 19:54
-
-
Save kindlich/b1b070d15c26f626d65c176a4b4786c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #loader contenttweaker | |
| //Note: Works fine when during CraftTweaker runtime as well! | |
| val builder = mods.contenttweaker.enchantments.EnchantmentBuilder.create("kindlich_chant"); | |
| builder.applicableSlots = [mainHand, offhand, feet, legs, chest, head]; | |
| builder.setTypeAll(); | |
| builder.setRarityVeryRare(); | |
| builder.calcModifierDamage = function(thisEnch, level, damageSource){ | |
| return level; | |
| }; | |
| builder.onUserHurt = function(thisEnch, entity, attacker, level) { | |
| entity.health = entity.maxHealth; | |
| if(entity instanceof crafttweaker.player.IPlayer) { | |
| val player as crafttweaker.player.IPlayer = entity; | |
| player.foodStats.addStats(100, 10.0f); | |
| } | |
| }; | |
| builder.register(); | |
| builder.name = "other_chant"; | |
| builder.domain = "definitely_not_cot"; | |
| builder.calcModifierDamage = null; | |
| builder.onUserHurt = function(thisEnch, player, attacker, level) { | |
| player.sendMessage("EARNED IT!"); | |
| }; | |
| builder.register(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment