白色的小熊
我是这样写的代码:
  1.     @EventHandler
  2.     public void PlayerInteractEvent(PlayerInteractEvent e) {
  3.         Player p = e.getPlayer();
  4.         if (e.getPlayer().getInventory().getItemInMainHand().isSimilar(item.MagicStick()) && e.getAction().equals(Action.RIGHT_CLICK_AIR)) {
  5.             Location location = p.getLocation();
  6.             for (double i = 0; i < 360; i +=10) {
  7.                 // 依然要做角度与弧度的转换
  8.                 double radians = Math.toRadians(i);
  9.                 // 计算出来的半径
  10.                 double radius = 1;
  11.                 double y = Math.sin(radians);
  12.                 for (double j = 0; j < 360; j +=10) {
  13.                     // 依然需要做角度转弧度的操作
  14.                     double radiansCircle = Math.toRadians(j);
  15.                     double x = Math.cos(radiansCircle) * radius;
  16.                     double z = Math.sin(radiansCircle) * radius;
  17.                     location.add(x, y, z);
  18.                     location.getWorld().spawnParticle(Particle.BLOCK_CRACK,location,5);
  19.                     location.subtract(x, y, z);
  20.                 }
  21.             }
  22.         }
  23.     }
复制代码
想做一个技能类插件,要求右键时生成自定义粒子模型,看了大佬的教程,愣是没看懂,有没有人用通俗易懂的语言帮我解答一下,这样写为什么会出错?

602723113
BLOCK_CRACK 需要添加方块数据
视频可以看 https://www.bilibili.com/video/B ... 0b29bc&t=1658.3 当中的材质性(Material)粒子

TS_cimao
就是在玩家脚下360度 放360个粒子的一些位置计算