Guest User

Untitled

a guest
Jul 29th, 2021
112
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public void spawnParticles(LivingEntity entity) {
  2.         Random offset = new Random();
  3.         Vector3d box = entity.getBoundingBox().getCenter();
  4.         Vector3d vec = entity.getLookAngle();
  5.         double x = vec.x;
  6.         double y = vec.y; //set that to zero?
  7.         double z = vec.z;
  8.         double strength = (double)this.getStrength() * 1.5D;
  9.         Vector3d look = new Vector3d(x, y, z);
  10.         //look.y = 0; just gives me an error when trying to use it. Tried writing it multiple other ways, but nothing seems to work
  11.         look.normalize();
  12.         look.scale(strength);
  13.  
  14.         for (int i = 0; i < 40; ++i) {
  15.             entity.level.addParticle(this.getSlamParticle(), box.x, box.y, box.z, look.x * offset.nextDouble(), 0, look.z * offset.nextDouble());
  16.             ProjectDawn.LOGGER.info(look.x + " " + look.y + " " + look.z);
  17.         }
  18.     }
RAW Paste Data