添加打腿减速,修复泰瑟只对玩家有效的bug,增强雨散弓单木仓
This commit is contained in:
parent
791bab7409
commit
553d6ae40a
5 changed files with 23 additions and 17 deletions
|
@ -1,10 +1,7 @@
|
|||
package net.mcreator.target.entity;
|
||||
|
||||
import net.mcreator.target.TargetMod;
|
||||
import net.mcreator.target.init.TargetModDamageTypes;
|
||||
import net.mcreator.target.init.TargetModEntities;
|
||||
import net.mcreator.target.init.TargetModParticleTypes;
|
||||
import net.mcreator.target.init.TargetModSounds;
|
||||
import net.mcreator.target.init.*;
|
||||
import net.mcreator.target.network.message.ClientIndicatorMessage;
|
||||
import net.mcreator.target.network.message.PlayerGunKillMessage;
|
||||
import net.mcreator.target.tools.ExtendedEntityRayTraceResult;
|
||||
|
@ -22,6 +19,8 @@ import net.minecraft.server.level.ServerLevel;
|
|||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
|
@ -54,7 +53,7 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
|||
protected int shooterId;
|
||||
private float damage = 1f;
|
||||
private float headShot = 1f;
|
||||
private float legShot = 0.4f;
|
||||
private float legShot = 0.5f;
|
||||
private boolean beast = false;
|
||||
|
||||
public ProjectileEntity(EntityType<? extends ProjectileEntity> p_i50159_1_, Level p_i50159_2_) {
|
||||
|
@ -371,6 +370,14 @@ public class ProjectileEntity extends Entity implements IEntityAdditionalSpawnDa
|
|||
TargetMod.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> player), new ClientIndicatorMessage(0, 5));
|
||||
}
|
||||
entity.hurt(TargetModDamageTypes.causeGunFireDamage(this.level().registryAccess(), this, this.shooter), this.damage * this.legShot);
|
||||
if (entity instanceof LivingEntity living) {
|
||||
if (living instanceof Player player && player.isCreative()){
|
||||
return;
|
||||
}
|
||||
if (!living.level().isClientSide()) {
|
||||
living.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN,20,2,false,false));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (!this.shooter.level().isClientSide() && this.shooter instanceof ServerPlayer player) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import net.minecraft.network.protocol.game.ClientGamePacketListener;
|
|||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
|
@ -99,16 +100,14 @@ public class TaserBulletProjectileEntity extends ThrowableItemProjectile {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.getOwner() instanceof LivingEntity source) {
|
||||
CompoundTag tag = source.getMainHandItem().getOrCreateTag();
|
||||
tag.putInt("hit_count", tag.getInt("hit_count") + 1);
|
||||
}
|
||||
|
||||
if (entity instanceof Player player && !player.isCreative()) {
|
||||
if (!player.level().isClientSide()) {
|
||||
player.addEffect(new MobEffectInstance(TargetModMobEffects.SHOCK.get(), 100, 0));
|
||||
if (entity instanceof LivingEntity living) {
|
||||
if (living instanceof Player player && player.isCreative()){
|
||||
return;
|
||||
}
|
||||
if (!living.level().isClientSide()) {
|
||||
living.addEffect(new MobEffectInstance(TargetModMobEffects.SHOCK.get(), 100, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"dev": 3.5,
|
||||
"recoil_x": 0.006,
|
||||
"recoil_y": 0.018,
|
||||
"damage": 1.5,
|
||||
"damage": 2,
|
||||
"headshot": 1.5,
|
||||
"velocity": 16,
|
||||
"mag": 25,
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
"dev": 5,
|
||||
"recoil_x": 0.005,
|
||||
"recoil_y": 0.026,
|
||||
"damage": 2.5,
|
||||
"damage": 3,
|
||||
"headshot": 1.5,
|
||||
"velocity": 12,
|
||||
"mag": 2,
|
||||
"projectile_amount": 8,
|
||||
"projectile_amount": 10,
|
||||
"fire_interval": 2,
|
||||
"weight": 0,
|
||||
"fire_mode": 0,
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"dev": 3,
|
||||
"recoil_x": 0.009,
|
||||
"recoil_y": 0.03,
|
||||
"damage": 2.4,
|
||||
"damage": 3,
|
||||
"headshot": 1.5,
|
||||
"velocity": 16,
|
||||
"mag": 8,
|
||||
|
|
Loading…
Add table
Reference in a new issue