Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions addons/mobs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Mobs

Display live mobs on your map.

## Configuration

### Global options

* `update-interval` - How often (in seconds) to update mobs on the map (default: `5`)

### Per-world options

* `enabled` - Enable or disable mobs for this world (default: `true`)
* `layer.label` - Name of the layer shown in the UI (default: `"Mobs"`)
* `layer.controls.enabled` - Show layer toggle controls (default: `true`)
* `layer.controls.hide-by-default` - Hide the layer by default (default: `false`)
* `layer.priority` - Layer stacking order (default: `999`)
* `layer.z-index` - CSS z-index for the layer (default: `999`)
* `icon.size` - Size in pixels of mob icons (default: `16`)
* `icon.tooltip` - Tooltip text when hovering over a mob. Use `{name}` for the mob name (default: `'{name}'`)
* `allowed-mobs` - List of mob types to display. Use Minecraft entity type names (lowercase with underscores). Use `'*'` to show all supported mobs. By default, only passive and neutral mobs are displayed.

### Allowed-mobs examples

Show all mobs:

```yaml
worlds:
world:
allowed-mobs:
- '*'
```

Show specific mobs (mix of passive and hostile):

```yaml
worlds:
world:
allowed-mobs:
- cow
- pig
- sheep
- blaze
- creeper
- skeleton
- zombie
```

## Supported mobs

### Passive/neutral

allay, armadillo, axolotl, bat, bee, camel, cat, chicken, cod, cow, dolphin, donkey, fox, frog, glow_squid, goat, happy_ghast, horse, iron_golem, llama, mooshroom, mule, nautilus, ocelot, panda, parrot, pig, polar_bear, pufferfish, rabbit, salmon, sheep, sniffer, snow_golem, squid, strider, tadpole, trader_llama, tropical_fish, turtle, villager, wandering_trader, wolf

#### Exceptions

camel_husk, zombie_horse & zombie_nautilus are not added to the default passive/neutral mobs list, since they become passive/neutral once their hostile mob rider gets separated from them.

---

### Hostile

blaze, breeze, camel_husk, cave_spider, creaking, creeper, drowned, elder_guardian, ender_dragon, enderman, endermite, evoker, ghast, giant, guardian, hoglin, husk, illusioner, magma_cube, parched, phantom, piglin, piglin_brute, pillager, ravager, shulker, silverfish, skeleton, skeleton_horse, slime, spider, stray, vex, vindicator, warden, witch, wither, wither_skeleton, zoglin, zombie, zombie_horse, zombie_nautilus, zombie_villager, zombified_piglin
2 changes: 2 additions & 0 deletions addons/mobs/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version = "1.1.0-SNAPSHOT"

description = "Mobs addon for squaremap"

bukkitPluginYaml {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,29 @@ private void allowedTypes() {
String.class,
"allowed-mobs",
List.of(
"allay",
"armadillo",
"axolotl",
"bat",
"bee",
"camel",
"cat",
"chicken",
"cod",
"cow",
"dolphin",
"donkey",
"fox",
"frog",
"glow_squid",
"goat",
"happy_ghast",
"horse",
"iron_golem",
"llama",
"mooshroom",
"mule",
"nautilus",
"ocelot",
"panda",
"parrot",
Expand All @@ -73,9 +85,11 @@ private void allowedTypes() {
"rabbit",
"salmon",
"sheep",
"sniffer",
"snow_golem",
"squid",
"strider",
"tadpole",
"trader_llama",
"tropical_fish",
"turtle",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,21 @@
public final class Icons {
public static final Map<EntityType, Key> BY_TYPE = new HashMap<>();

public static final Key ALLAY = register("allay");
public static final Key ARMADILLO = register("armadillo");
public static final Key AXOLOTL = register("axolotl");
public static final Key BAT = register("bat");
public static final Key BEE = register("bee");
public static final Key BLAZE = register("blaze");
public static final Key BREEZE = register("breeze");
public static final Key CAMEL = register("camel");
public static final Key CAMEL_HUSK = register("camel_husk");
public static final Key CAT = register("cat");
public static final Key CAVE_SPIDER = register("cave_spider");
public static final Key CHICKEN = register("chicken");
public static final Key COD = register("cod");
public static final Key COW = register("cow");
public static final Key CREAKING = register("creaking");
public static final Key CREEPER = register("creeper");
public static final Key DOLPHIN = register("dolphin");
public static final Key DONKEY = register("donkey");
Expand All @@ -33,9 +40,13 @@ public final class Icons {
public static final Key ENDERMITE = register("endermite");
public static final Key EVOKER = register("evoker");
public static final Key FOX = register("fox");
public static final Key FROG = register("frog");
public static final Key GHAST = register("ghast");
public static final Key GIANT = register("giant");
public static final Key GLOW_SQUID = register("glow_squid");
public static final Key GOAT = register("goat");
public static final Key GUARDIAN = register("guardian");
public static final Key HAPPY_GHAST = register("happy_ghast");
public static final Key HOGLIN = register("hoglin");
public static final Key HORSE = register("horse");
public static final Key HUSK = register("husk");
Expand All @@ -46,8 +57,10 @@ public final class Icons {
public static final Key MAGMA_CUBE = register("magma_cube");
public static final Key MOOSHROOM = register("mooshroom");
public static final Key MULE = register("mule");
public static final Key NAUTILUS = register("nautilus");
public static final Key OCELOT = register("ocelot");
public static final Key PANDA = register("panda");
public static final Key PARCHED = register("parched");
public static final Key PARROT = register("parrot");
public static final Key PHANTOM = register("phantom");
public static final Key PIG = register("pig");
Expand All @@ -65,25 +78,29 @@ public final class Icons {
public static final Key SKELETON = register("skeleton");
public static final Key SKELETON_HORSE = register("skeleton_horse");
public static final Key SLIME = register("slime");
public static final Key SNIFFER = register("sniffer");
public static final Key SNOW_GOLEM = register("snow_golem");
public static final Key SPIDER = register("spider");
public static final Key SQUID = register("squid");
public static final Key STRAY = register("stray");
public static final Key STRIDER = register("strider");
public static final Key TADPOLE = register("tadpole");
public static final Key TRADER_LLAMA = register("trader_llama");
public static final Key TROPICAL_FISH = register("tropical_fish");
public static final Key TURTLE = register("turtle");
public static final Key VEX = register("vex");
public static final Key VILLAGER = register("villager");
public static final Key VINDICATOR = register("vindicator");
public static final Key WANDERING_TRADER = register("wandering_trader");
public static final Key WARDEN = register("warden");
public static final Key WITCH = register("witch");
public static final Key WITHER = register("wither");
public static final Key WITHER_SKELETON = register("wither_skeleton");
public static final Key WOLF = register("wolf");
public static final Key ZOGLIN = register("zoglin");
public static final Key ZOMBIE = register("zombie");
public static final Key ZOMBIE_HORSE = register("zombie_horse");
public static final Key ZOMBIE_NAUTILUS = register("zombie_nautilus");
public static final Key ZOMBIE_VILLAGER = register("zombie_villager");
public static final Key ZOMBIFIED_PIGLIN = register("zombified_piglin");

Expand All @@ -107,7 +124,7 @@ private static Key register(String name) {

BY_TYPE.put(type, key);
} catch (final Exception e) {
SquaremapMobs.getInstance().getLogger().log(Level.WARNING, "Failed to register signs icon", e);
SquaremapMobs.getInstance().getLogger().log(Level.WARNING, "Failed to register mobs icon", e);
}
return key;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ public void run() {
if (loc.getY() < this.worldConfig.minimumY) {
continue;
}
if (this.worldConfig.surfaceOnly && aboveSurface(loc)) {
if (this.worldConfig.surfaceOnly && belowSurface(loc)) {
continue;
}
this.handleMob(type, mob.getEntityId(), loc);
}
}

private static boolean aboveSurface(final Location loc) {
private static boolean belowSurface(final Location loc) {
return loc.getY() < loc.getWorld().getHighestBlockYAt(loc.getBlockX(), loc.getBlockZ(), HeightMap.WORLD_SURFACE);
}

Expand Down
Binary file added addons/mobs/src/main/resources/icons/allay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/armadillo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/axolotl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/breeze.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/camel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/camel_husk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/creaking.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/frog.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/glow_squid.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/goat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/happy_ghast.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/nautilus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/parched.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/sniffer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added addons/mobs/src/main/resources/icons/tadpole.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Binary file added addons/mobs/src/main/resources/icons/warden.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.