Skip to content

Add projectile entity support to geo-limit-settings#2863

Merged
tastybento merged 2 commits into
developfrom
copilot/add-geo-limit-projectiles
Mar 14, 2026
Merged

Add projectile entity support to geo-limit-settings#2863
tastybento merged 2 commits into
developfrom
copilot/add-geo-limit-projectiles

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 14, 2026

Projectile entities (snowballs, arrows, fireballs, etc.) accumulate over time on islands but were not configurable via geo-limit-settings. This adds support for geo-limiting projectiles so they are removed when they leave island bounds.

Changes

GeoMobLimitTab

  • Added PROJECTILE_ENTITY_TYPES: auto-discovered via Projectile.class.isAssignableFrom(entityType.getEntityClass()) — covers arrows, snowballs, fireballs, tridents, wind charges, wither skulls, ender pearls, potions, etc.
  • Added GEO_LIMIT_ENTITY_TYPES: merged + sorted combination of living entity types and projectile types.
  • The GEO_LIMIT tab now renders both living entities and projectiles; MOB_LIMIT tab is unchanged (living entities only).
  • Extracted getEntityTypes() to select the right list per tab type.

GeoLimitMobsListener

  • Added onProjectileLaunch handler: when a projectile is launched inside a BentoBox world and its EntityType name is present in the geo-limit settings, it is added to the mobSpawnTracker. The existing periodic removal task handles cleanup when the projectile travels outside island bounds.
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
public void onProjectileLaunch(final ProjectileLaunchEvent e) {
    if (getIWM().inWorld(e.getEntity().getLocation())
            && getIWM().getGeoLimitSettings(e.getEntity().getLocation().getWorld()).contains(e.getEntityType().name())) {
        getIslands().getIslandAt(e.getEntity().getLocation()).ifPresent(i -> mobSpawnTracker.put(e.getEntity(), i));
    }
}

Tests

  • New GeoLimitMobsListenerTest covering: projectile tracked, type not in list, not in BentoBox world, no island at launch location.
Original prompt

This section details on the original issue you should resolve

<issue_title>Geo-limit-settings improvement</issue_title>
<issue_description>### Is your feature request related to a problem?

I would like to add not only regular mobs, but also their projectiles, because they accumulate over time, such as snowballs or eggs.

Describe the solution you'd like.

Add to this geo-limit-settings as:

- small_fireball
- dragon_fireball
- firework_rocket
- llama_spit
- arrow
- spectral_arrow
- shulker_bullet
- experience_bottle
- egg
- ender_pearl
- eye_of_ender
- snowball
- potion
- trident
- wind_charge
- breeze_wind_charge
- wither_skull

Describe alternatives you've considered.

There are none

Agreements

  • I have searched for and ensured there isn't already an open issue regarding this.
  • I have ensured the feature I'm requesting isn't already in the latest supported BentoBox build or Addons.

Other

https://github.com/user-attachments/assets/8d179b05-3cf0-4c52-a475-05573c37f005</issue_description>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
Copilot AI changed the title [WIP] Add geo-limit-settings for projectiles Add projectile entity support to geo-limit-settings Mar 14, 2026
Copilot AI requested a review from tastybento March 14, 2026 21:19
@tastybento tastybento marked this pull request as ready for review March 14, 2026 21:21
@sonarqubecloud
Copy link
Copy Markdown

@tastybento tastybento merged commit bdaeadc into develop Mar 14, 2026
3 checks passed
@tastybento tastybento deleted the copilot/add-geo-limit-projectiles branch March 14, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Geo-limit-settings improvement

2 participants