eh?
This commit is contained in:
parent
8ffb2ce3b1
commit
49ee0a6a5f
@ -210,8 +210,8 @@ fun addLootModifiers(it: LootModifiers) {
|
||||
KilledByRealPlayerOrIndirectly
|
||||
),
|
||||
|
||||
ItemStack(MItems.WITHERED_STEEL, 1) to 0.24,
|
||||
ItemStack(MItems.WITHERED_STEEL, 2) to 0.11
|
||||
ItemStack(MItems.WITHERED_STEEL, 1) to 0.15,
|
||||
ItemStack(MItems.WITHERED_STEEL, 2) to 0.1
|
||||
))
|
||||
|
||||
it.add("wither_exosuit_upgrades", BasicLootAppender(
|
||||
|
@ -6,6 +6,7 @@ import net.neoforged.bus.api.EventPriority
|
||||
import net.neoforged.fml.common.Mod
|
||||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent
|
||||
import net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent
|
||||
import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent
|
||||
import ru.dbotthepony.mc.otm.android.AndroidResearchDescription
|
||||
import ru.dbotthepony.mc.otm.android.AndroidResearchDescriptions
|
||||
import ru.dbotthepony.mc.otm.android.AndroidResearchManager
|
||||
@ -53,6 +54,7 @@ import ru.dbotthepony.mc.otm.config.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.config.ToolsConfig
|
||||
import ru.dbotthepony.mc.otm.data.FlywheelMaterials
|
||||
import ru.dbotthepony.mc.otm.data.world.DecimalProvider
|
||||
import ru.dbotthepony.mc.otm.entity.WitheredSkeletonSpawnHandler
|
||||
import ru.dbotthepony.mc.otm.item.ChestUpgraderItem
|
||||
import ru.dbotthepony.mc.otm.item.tool.ExplosiveHammerItem
|
||||
import ru.dbotthepony.mc.otm.item.armor.TritaniumArmorItem
|
||||
@ -221,6 +223,9 @@ object OverdriveThatMatters {
|
||||
|
||||
FORGE_BUS.addListener(EventPriority.LOWEST, KillAsAndroidTrigger::onKill)
|
||||
|
||||
//fuck if I know
|
||||
FORGE_BUS.addListener(EventPriority.NORMAL, WitheredSkeletonSpawnHandler::onEntityJoin)
|
||||
|
||||
FORGE_BUS.addListener(EventPriority.NORMAL, EnderTeleporterFeature.Companion::onEntityDeath)
|
||||
FORGE_BUS.addListener(EventPriority.HIGH, TritaniumArmorItem.Companion::onHurt)
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
package ru.dbotthepony.mc.otm.entity
|
||||
|
||||
import net.minecraft.world.entity.EquipmentSlot
|
||||
import net.minecraft.world.entity.monster.WitherSkeleton
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.Items
|
||||
import net.neoforged.bus.api.SubscribeEvent
|
||||
import net.neoforged.neoforge.event.entity.EntityJoinLevelEvent
|
||||
import ru.dbotthepony.mc.otm.registry.game.MItems
|
||||
|
||||
|
||||
object WitheredSkeletonSpawnHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
fun onEntityJoin(event: EntityJoinLevelEvent) {
|
||||
val entity = event.entity
|
||||
if (entity is WitherSkeleton){
|
||||
|
||||
val giveHelmet = entity.random.nextFloat() < 0.1f
|
||||
val giveSword = entity.random.nextFloat() < 0.24f
|
||||
|
||||
if (giveHelmet) {
|
||||
entity.setItemSlot(EquipmentSlot.HEAD, ItemStack(Items.NETHERITE_HELMET))
|
||||
entity.setItemSlot(EquipmentSlot.MAINHAND, ItemStack(MItems.WITHERED_STEEL_SWORD))
|
||||
} else if (giveSword) {
|
||||
entity.setItemSlot(EquipmentSlot.MAINHAND, ItemStack(MItems.WITHERED_STEEL_SWORD))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -41,7 +41,7 @@ class WitheredSteelSwordItem(properties: Item.Properties) : SwordItem(Tiers.IRON
|
||||
}
|
||||
|
||||
override fun hurtEnemy(stack: ItemStack, target: LivingEntity, attacker: LivingEntity): Boolean {
|
||||
target.addEffect(MobEffectInstance(MobEffects.WITHER, 100, 0)) // 5s Wither II
|
||||
target.addEffect(MobEffectInstance(MobEffects.WITHER, 100, 0))
|
||||
return super.hurtEnemy(stack, target, attacker)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user