ploppyperson / StackMob-5

A plugin for bukkit servers, which aims to reduce the lag that the server experiences by combining several entities into a single entity.
GNU General Public License v3.0
54 stars 20 forks source link

Limit Stacks in a Radius #166

Open ghost opened 3 years ago

ghost commented 3 years ago

Hi,  the title says it all. Some Players abuse the StackMob function by spawning 100s of chickens to get exps really quick. Can I prevent the Spawns of Chickens (for example) in a Radius of 10 blocks if there are already like 4 Stacks of 30x Chickens?

Thanks :)

ghost commented 3 years ago

This is my config btw:

StackMob 5.4.1 Configuration file - by antiPerson and contributors.

#

Most options can be customised for specific entity types, for details about this, see the end of this file.

Asterisk meaning:

(*) This option cannot be overridden in the 'custom' section at the end of this file.

(**) The following option requires the use of Paper (https://papermc.io) because the API needed is not in Spigot.

Lists of valid options:

(1) https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html

(2) https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/CreatureSpawnEvent.SpawnReason.html

(3) https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html

(4) https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html

#

If the comments have been removed, you can find a version with comments at https://github.com/Nathat23/StackMob-5/tree/master/src/main/resources

stack:

The maximum size that a stack can have.

max-size: 30

How often entities should be checked for stacking (in ticks. 20 ticks = 1 second) (*)

interval: 100

The area around an entity for which applicable stacks should be found.

Format: [(x cord),(y cord),(z cord)]

merge-range: [6,6,6]

Only begin to stack entities when this amount of entities are nearby.

threshold: enabled: true amount: 5

Names of worlds where there should be no stacking

worlds-blacklist: [] worlds-blacklist-invert: false

Types of entity which should not stack (3)

types-blacklist: [VILLAGER] types-blacklist-invert: false

If the entity's spawn reason is listed below, do not stack. (2)

reason-blacklist:

display-name:

The formatting of the name tag which is shown when the stack size is above the threshold.

Both legacy and RGB hex color codes are supported, these need to be prefixed by the '&' symbol.

Placeholders:

%type% - the entity's type

%size% - the size of the stack

format: '&7%type% &6(%size%)'

Whether the display tag can only be seen when the player targets the entity.

Mode:

ALWAYS - The tag will always be visible as long as the entity is loaded.

HOVER - The tag will only be visible when the player hovers their crosshair on the entity.

NEARBY - The tag will only be visible when the player is in range of the entity. (more resource intensive, requires ProtocolLib on 1.15 servers)

visibility: NEARBY

Options for when 'NEARBY' is used above. (*)

nearby:

The range from which the tag should be visible.

# Format: [(x cord),(y cord),(z cord)]
range: [12,6,12]
# How often (in ticks) the tag visibility status of an entity should be updated. (20 ticks = 1 second)
interval: 20

Don't show the tag if the stack size of this entity if it is equal to or below the value specified.

threshold: 1

Whether entity specific traits (eg. profession, colour) should be segregated (*)

traits: sheep-color: true sheep-sheared: true slime-size: true horse-color: true llama-color: true parrot-variant: true drowned-hand-item: true age: true breed-mode: true love-mode: true cat-type: true mooshroom-variant: true fox-type: true bee-nectar: true bee-stung: true zoglin-baby: true piglin-baby: true leashed: true

Prevent stacked mobs from targeting players.

Similar to no-ai, but allows for movement of entities.

disable-targeting: enabled: false

If the entity's type is listed below, do not disable targeting.

type-blacklist: [] type-blacklist-invert: false

If the entity's spawns reason is listed below, do not disable targeting (**)

reason-blacklist: [] reason-blacklist-invert: false

What should be done when these entity actions occur. (*)

events:

When an entity picks up armor or other equipment

equip: enabled: true

IGNORE - do not take picked up equipment into consideration when stacking

# DROP_ITEMS - drop picked up items when about to stack
# PREVENT_STACK - do not stack this entity.
mode: IGNORE

When an entity is feed its food.

breed: enabled: true

MULTIPLY - spawn as many baby entities possible providing there is enough food fed.

# SPLIT - slice off an entity to that it can be bred normally.
mode: MULTIPLY
# Limit the amount of baby entities spawned when using MULTIPLY mode. -1 = disabled.
limit: 10

When an entity is dyed.

dye: enabled: true

MULTIPLY - dye as many entities possible providing there is enough dye.

# SPLIT - slice off an entity to that it can be dyed normally.
mode: MULTIPLY
# Limit the amount of sheep dyed when using MULTIPLY mode. -1 = disabled.
limit: -1

When an entity is sheared.

shear: enabled: true

MULTIPLY - shear as many entities possible providing the shears have enough durability.

# SPLIT - slice off an entity to that it can be sheared normally.
mode: MULTIPLY
# Limit the amount of sheep sheared when using MULTIPLY mode. -1 = disabled.
limit: -1

multiply:

Chicken eggs and turtle scutes.

drops: false
explosion: true
slime-split: true

divide: nametag: true tame: true

Only bees now

enter-block: true

remove-stack-data:

Should we remove the stack data of an entity that was unstacked as a result of nametag division/split?

# Setting this to false will cause entities that were nametagged to potentially become stacked again.
nametag: true

How entities should die

death:

Rather than spawn a new entity in place of the killed entity, just decrease the stack size instead. (**)

skip-animation: false

Death amount options:

SINGLE - Only one entity dies.

ALL - Every entity dies.

STEP - A random amount dies.

STEP_DAMAGE - An amount that depends on the damage done dies.

#

Each death option has it's own blacklist for entity traits:

reason-blacklist - the last damage cause of the entity, which results in is death. (1)

spawn-reason-blacklist - the spawn reason of the entity. (**) (2)

type-blacklist - entity type. (3)

#

The priority 1 is highest and 4 is lowest.

If the killed entity is blacklisted, either by type, spawn reason or death reasons (the last damage cause),

by the highest priority method, then it will attempt to use the next highest priority death method.

SINGLE: priority: 4 reason-blacklist: [] reason-blacklist-invert: false spawn-reason-blacklist: [] spawn-reason-blacklist-invert: false type-blacklist: [] type-blacklist-invert: false ALL: priority: 3 reason-blacklist: [] reason-blacklist-invert: false spawn-reason-blacklist: [ ] spawn-reason-blacklist-invert: false type-blacklist: [] type-blacklist-invert: false STEP: priority: 2 reason-blacklist: [] reason-blacklist-invert: false spawn-reason-blacklist: [ ] spawn-reason-blacklist-invert: false type-blacklist: [] type-blacklist-invert: false max-step: 5 min-step: 1 STEP_DAMAGE: priority: 1 reason-blacklist: [] reason-blacklist-invert: false spawn-reason-blacklist: [ ] spawn-reason-blacklist-invert: false type-blacklist: [] type-blacklist-invert: false

Multiply entity drops on entity death.

drops: enabled: true use-loot-tables: true

If each mob should only drop one of the items in the list. (4)

one-per-stack: [Chicken] one-per-stack-invert: false

Items that should not be dropped. (4)

item-blacklist: [egg] item-blacklist-invert: false

Death reasons that should not mean that drops are multiplied. (1)

reason-blacklist: [] reason-blacklist-invert: false

Types of entity for which drops should not be dropped for. (3)

type-blacklist: [] type-blacklist-invert: false

Multiply entity experience on entity death.

experience: enabled: true

The bounds that should be used for the random multiplier.

multiplier-min: 0.5 multiplier-max: 0.8

Types of entity for which exp should not be dropped for. (3)

type-blacklist: [chicken] type-blacklist-invert: false

Multiply the player stats which can be seen by the player from the game menu.

player-stats: true

If specific entities should have a waiting time before their first stack.

Designed for monster grinders etc.

wait-to-stack: enabled: true

For (x) times the stack task fires after spawn, don't stack this entity.

wait-time: 5

Entity types that this should work for. (3)

types-whitelist:

Enable/disable integration with other plugins. (*)

hooks:

Allows the custom 'entity-stacking' flag to be used in worldguard regions.

worldguard: true mythicmobs: enabled: true blacklist: [] blacklist-invert: false

Prevent citizens npcs from stacking.

citizens: true

Prevent stacked entities from giving mcmmo experience.

mcmmo: true

Prevent stacked entities from giving job payments.

jobs: true

Allows the use of ProtocolLib, which is used when the server version is not the native one of the plugin.

protocollib: true

Some options can be modified for specific entity types. An example is shown below. Remove comments to see this in action.

Options and sections with a (*) in the comment preceding cannot be overridden.

custom:

The entity type

CREEPER:

The option to override. This should be the same as it appears above.

stack:

max-size: 30

SKELETON:

Entities can also inherit options from other entities, using the 'clone' option preceded by the entity type to clone.

clone: CREEPER

The cloned custom options can still be overridden.

stack:

max-size: 5

ploppyperson commented 3 years ago

I've hidden your config since it fills the entire page.

You could use a mob farm limiter plugin?

NanoAi commented 3 years ago

Try reducing your random experience multiplier, or lowering the values. Also I believe your blacklist has to have "CHICKEN" in all caps as per https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/EntityType.html.