我是这样写的代码:复制代码想做一个技能类插件,要求右键时生成自定义粒子模型,看了大佬的教程,愣是没看懂,有没有人用通俗易懂的语言帮我解答一下,这样写为什么会出错?
-     @EventHandler
 
-     public void PlayerInteractEvent(PlayerInteractEvent e) {
 
-         Player p = e.getPlayer();
 
-         if (e.getPlayer().getInventory().getItemInMainHand().isSimilar(item.MagicStick()) && e.getAction().equals(Action.RIGHT_CLICK_AIR)) {
 
-             Location location = p.getLocation();
 
-             for (double i = 0; i < 360; i +=10) {
 
-                 // 依然要做角度与弧度的转换
 
-                 double radians = Math.toRadians(i);
 
-                 // 计算出来的半径
 
-                 double radius = 1;
 
-                 double y = Math.sin(radians);
 
-                 for (double j = 0; j < 360; j +=10) {
 
-                     // 依然需要做角度转弧度的操作
 
-                     double radiansCircle = Math.toRadians(j);
 
-                     double x = Math.cos(radiansCircle) * radius;
 
-                     double z = Math.sin(radiansCircle) * radius;
 
-                     location.add(x, y, z);
 
-                     location.getWorld().spawnParticle(Particle.BLOCK_CRACK,location,5);
 
-                     location.subtract(x, y, z);
 
-                 }
 
-             }
 
-         }
 
- }
BLOCK_CRACK 需要添加方块数据
视频可以看 https://www.bilibili.com/video/B ... 0b29bc&t=1658.3 当中的材质性(Material)粒子
视频可以看 https://www.bilibili.com/video/B ... 0b29bc&t=1658.3 当中的材质性(Material)粒子
就是在玩家脚下360度 放360个粒子的一些位置计算