Skip to content

Commit

Permalink
Sculk Jaw and Sculk Leech drain XP again. Only four points, can be ad…
Browse files Browse the repository at this point in the history
…justed.
  • Loading branch information
nitrodynamite18 committed Nov 8, 2023
1 parent bfa9375 commit f0266b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ public void stepOn(Level pLevel, BlockPos pPos, BlockState pState, Entity pEntit
if(pState.getValue(CAN_BITE) && pEntity instanceof LivingEntity entity) {
pLevel.setBlock(pPos, pState.setValue(BITING, true), 3);
entity.hurt(DDDamageTypes.source(pLevel, DDDamageTypes.JAW, entity, null), 3);
if (pEntity instanceof Player player) player.giveExperiencePoints(-4);
pLevel.scheduleTick(pPos, this, 35);
}
}

@Override
public void tick(BlockState pState, ServerLevel pLevel, BlockPos pPos, RandomSource pRandom) {
if(pState.getValue(BITING)) {
pLevel.setBlock(pPos, pState.setValue(BITING, false), 3);
}
if(pState.getValue(BITING)) pLevel.setBlock(pPos, pState.setValue(BITING, false), 3);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public MobType getMobType() {
@Override
public boolean doHurtTarget(Entity pEntity) {
this.level().broadcastEntityEvent(this, (byte) 4);
if (pEntity instanceof Player player) player.giveExperiencePoints(-4);
return super.doHurtTarget(pEntity);
}

Expand All @@ -60,10 +61,7 @@ public void tick() {

@Override
public void handleEntityEvent(byte pId) {
if(pId == 4) {
this.attackState.start(this.tickCount);
} else {
super.handleEntityEvent(pId);
}
if(pId == 4) this.attackState.start(this.tickCount);
else super.handleEntityEvent(pId);
}
}

0 comments on commit f0266b6

Please sign in to comment.