-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Certain End Tools now also has an increased chance to inflict Bleeding
- Loading branch information
Showing
2 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
25 changes: 25 additions & 0 deletions
25
.../java/com/majruszs_difficulty/features/end_items/when_damaged/EndToolsBleedingOnHurt.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.majruszs_difficulty.features.end_items.when_damaged; | ||
|
||
import com.majruszs_difficulty.features.end_items.EndItems; | ||
import com.majruszs_difficulty.features.when_damaged.WhenDamagedApplyBleedingBase; | ||
import net.minecraft.entity.LivingEntity; | ||
import net.minecraft.util.DamageSource; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** Makes certain End Tools have an extra chance to inflict Bleeding effect. */ | ||
public class EndToolsBleedingOnHurt extends WhenDamagedApplyBleedingBase { | ||
private static final String CONFIG_NAME = "EndToolsBleeding"; | ||
private static final String CONFIG_COMMENT = "End Axe, End Sword and End Hoe have a greater chance to inflict Bleeding."; | ||
|
||
public EndToolsBleedingOnHurt() { | ||
super( CONFIG_NAME, CONFIG_COMMENT, 0.5, 24.0 ); | ||
} | ||
|
||
/** Checking if all conditions were met. */ | ||
@Override | ||
public boolean shouldBeExecuted( @Nullable LivingEntity attacker, LivingEntity target, DamageSource damageSource ) { | ||
return attacker != null && EndItems.haveExtraBleedingChance( attacker.getHeldItemMainhand() | ||
.getItem() ) && super.shouldBeExecuted( attacker, target, damageSource ); | ||
} | ||
} |