TallYate Posted June 18, 2020 Posted June 18, 2020 public static void handle(key msg, Supplier<NetworkEvent.Context> ctx) { if (msg.key == 0 && ctx.get().getSender().getItemStackFromSlot(EquipmentSlotType.FEET) .getItem() == ModItems.KABOOTS.get()) { ctx.get().enqueueWork(() -> { ServerPlayerEntity sender = ctx.get().getSender(); Vec3d pos = sender.getPositionVec(); Vec3d look = sender.getLookVec(); double x = pos.getX() - (look.getX() / 2); double y = pos.getY() - 0.3; double z = pos.getZ() - (look.getZ() / 2); float size = 1.0F; sender.world.createExplosion(sender, (DamageSource) null, x, y, z, size, false, Explosion.Mode.BREAK); int k1 = MathHelper.floor(x - size - 1.0D); int l1 = MathHelper.floor(x + size + 1.0D); int i2 = MathHelper.floor(y - size - 1.0D); int i1 = MathHelper.floor(y + size + 1.0D); int j2 = MathHelper.floor(z - size - 1.0D); int j1 = MathHelper.floor(z + size + 1.0D); List<Entity> list = sender.getEntityWorld().getEntitiesWithinAABB(LivingEntity.class, new AxisAlignedBB((double) k1, (double) i2, (double) j2, (double) l1, (double) i1, (double) j1), Predicates.instanceOf(LivingEntity.class)); for (int i = 0; i < list.size(); i++) { list.get(i).setVelocity(0, 0, 25); CrudeTechMod.log(list.get(i).toString()); } }); } ctx.get().setPacketHandled(true); } I am logged, but my velocity doesn't change ServerPlayerEntity['Dev'/50, l='test', x=-299.80, y=3.25, z=433.91] Quote
[NoOneButNo] Posted June 18, 2020 Posted June 18, 2020 ctx.get().enqueueWork(() -> { This should be always the first one. Quote
TallYate Posted June 18, 2020 Author Posted June 18, 2020 Apparently movement is client-side so that's why it doesn't move me Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.