Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-7425

[API]Increased Return to all entities in the line of sight

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • 1.20.1
    • Yes

      提议内容:
      为Spigot引入一项新功能,该功能将增加视线上所有实体的返回效果。这将允许服务器管理员和开发者通过API在游戏中实现更多的交互和创造力。
       
      功能说明:
      1. API增强:引入一个新的API方法,允许开发者获取特定/全部的玩家/实体视线上的所有实体列表。
      开发者可以指定检测的距离。
         示例代码:
         List<Entity> getEntitiesInLineOfSight(Player player);
       
      2. 事件通知:引入一个事件,当实体受到返回效果时触发。这样,开发者可以监听该事件并执行自定义的操作,如特效、声音或其他效果。
         示例代码:
         @EventHandler
         public void onEntityReturn(EntityReturnEvent event)

      {        Entity entity = event.getEntity();        // 执行自定义操作,如特效、声音等    }

      3. 应用实例
      一个怪物视线穿墙的插件,使怪物透过墙壁看到玩家并追踪
       
      Proposal:
       
      Introduce a new feature to Spigot that enhances the return effect for all entities in the line of sight. This feature will allow server administrators and developers to achieve more interactivity and creativity in the game through the API.
       
      Feature Description:
       
      1. API Enhancement: Introduce a new API method that enables developers to retrieve a list of all entities in the line of sight of a specific/all players. Developers can specify the distance of detection.
         Example code:
         List<Entity> getEntitiesInLineOfSight(Player player);
       
      2. Event Notification: Introduce an event that triggers when an entity is affected by the return effect. This will enable developers to listen to the event and execute custom actions such as special effects, sounds, or other effects.
         Example code:
         @EventHandler
         public void onEntityReturn(EntityReturnEvent event)

      {        Entity entity = event.getEntity();        // Perform custom actions such as special effects, sounds, etc.    }

       
      3. Use Case:
         - A plugin that allows monsters to see players through walls and track them by extending their line of sight.
       
      By implementing this feature, server administrators and developers will have more creative possibilities and interactive gameplay. Whether it's creating interesting gameplay mechanics, enhancing PvP combat experiences, or designing new challenges for adventure maps, this feature will provide them with greater opportunities.

            Unassigned Unassigned
            Steven_w Steven Wang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: