Skip to content

Commit

Permalink
Update RemoveBlindness.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Decryptu committed Jan 17, 2025
1 parent 7a5c0be commit 7c3cfc9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/removeblindness/RemoveBlindness.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ public RemoveBlindness(IEventBus modEventBus) {
}

@SubscribeEvent
public void onEffectAdded(MobEffectEvent.Added event) {
if (event.getEntity() instanceof Player) {
public void onEffectApplicable(MobEffectEvent.Applicable event) {
if (event.getEntity() instanceof Player && event.getEffectInstance() != null) {
if (event.getEffectInstance().getEffect() == MobEffects.BLINDNESS
&& event.getEffectInstance().getDuration() == Integer.MAX_VALUE
&& event.getEffectInstance().getAmplifier() == 255) {
event.setCanceled(true);
event.setResult(MobEffectEvent.Applicable.Result.DO_NOT_APPLY);
LOGGER.debug("Prevented BasicLogin blindness effect on player {}",
((Player)event.getEntity()).getName().getString());
}
Expand Down

0 comments on commit 7c3cfc9

Please sign in to comment.