Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LM4 Buffs System #424

Closed
10 of 13 tasks
lokka30 opened this issue Nov 6, 2022 · 3 comments
Closed
10 of 13 tasks

LM4 Buffs System #424

lokka30 opened this issue Nov 6, 2022 · 3 comments
Assignees
Labels
priority: normal Normal priority status: confirmed Confirmed by a maintainer type: improvement Add or adjust a feature
Milestone

Comments

@lokka30
Copy link
Member

lokka30 commented Nov 6, 2022

Note: To keep this issue easy to read, completed branches of this to-do list are removed once they are completed.

@lokka30 lokka30 added type: improvement Add or adjust a feature priority: normal Normal priority status: confirmed Confirmed by a maintainer labels Nov 6, 2022
@lokka30 lokka30 added this to the v4.0 milestone Nov 6, 2022
@lokka30 lokka30 self-assigned this Nov 6, 2022
@lokka30 lokka30 pinned this issue Nov 6, 2022
@lokka30 lokka30 changed the title LM4 Buff System Impl Finalisations LM4 Buffs System Nov 7, 2022
@lokka30

This comment was marked as resolved.

@lokka30
Copy link
Member Author

lokka30 commented Nov 13, 2022

LM4 Custom Drops Config Changes

Useful links for brainstorming: LM3 CustomDrop Docs; LM3 Oath's Example CustomDrops; LM3 CustomDrops.yml

Preview

Settings Documentation

Root File Sections

Name Description
entities Allows custom drops to be set for individual entity types.
groups Allows custom drops to be set for groups defined in groups.yml.
drop-tables Allows drop tables to be created which can be shared amongst entity types.

Drop Recipient / Table Settings

Key Default Value Description
overall-chance 100 Chance for any of the drops in the drops section it is declared in to be processed at all.
overall-permissions [] Requires mob in question to be killed by a player AND have all of the declared permissions in order for any of the drops in the drops section it is declared in to be processed at all.
entities [] A modal list of entities which are included in the drop table by default. This does not affect the per-entity and per-group custom drop lists.

Drop Settings

Key Data Type Default Description Applicable Drop Types
material Text Declares an item-type CustomDrop. If its conditions apply, then this item can be dropped and/or equipped by the mob. Item
command Text Declares an command-type CustomDrop. If its conditions apply, then this command can be ran on-spawn and/or on-death of the mob. Command
chance Decimal 100.0 Chance for the item to be dropped / command to be ran. Item, Command
only-drop-if-equipped Boolean true If an item has a chance to be equipped, and this is set to true, then LM will not drop the item upon death unless the item is equipped. Item
name Text Display name of the item. Item
amount Integer 1 Quantity of the item. Item
min-level Integer Minimum level of the mob required. Item, Command
max-level Integer Maxium level of the mob required. Item, Command
custom-model-data Integer ` Allows CustomModelData to be set on the item. Item
no-multiplier Boolean true Prevents CustomDrop from being multiplied by the item-drop mob buff. Item
no-spawner Boolean true Prevents CustomDrop from happening on a mob spawned by a Monster Spawner block. Item, Command
priority Integer 0 Priority that a CustomDrop will have within its drop-group-id. Item, Command
max-drops-in-group Integer Sets the maximum amount of CustomDrops that a mob can receive from the same drop-group-id. Item, Command
item-flags List [] List item flag constants which will be applied to the item. Item
drop-group-id Text 0 Allows custom drops to be grouped together so that they can be managed as an aggregate, such as by using max-drops-in-group. Item, Command
chunk-kill-limited Boolean true Uses the chunk kill limiter system configured in settings.yml on this CustomDrop so that it is harder to farm in the same chunk using a mob grinder. Item, Command
durability-loss Integer 0 Decreases the durability of the item by the specified amount. Item
enchantments Defines a list of enchantments to put on the item. Described below this table. Item
overrides-vanilla-drops Boolean false Represents whether the vanilla item drops of the mob should be cleared or not. Item, Command
overrides-non-vanilla-drops Boolean false Represents whether the non-vanilla item drops (artificially added by other plugins) of the mob should be cleared or not. Item
permissions List [] Represents a required list of permissions for the player who killed the mob for the custom drops to happen. Note that this also requires the mob to be killed by a player. Item, Command
formula-condition Text Allows you to create your own boolean condition utilizing LevelledMobs context placeholders and PAPI placeholders. A mathematical result of 0 means the condition is false, any other value represents true. Item, Command
cause-of-death List ["PLAYER"] The entity must have been killed through any of the listed death cause constants. Item, Command
run List ["ON_DEATH"] Denotes when the command should be ran. Available options: ON_DEATH, ON_SPAWN. Command
delay Time Represents a delay before the command will be ran. Command

Enchantments

The process of applying enchantments to Custom Drop items is explained below.

enchantments:
  - enchantment: "Unbreaking"
    strength: 1
    chance: 75
  - enchantment: "Unbreaking"
    strength: 2-3
    chance: 25

Example File

mob-groups:
  - mob-group: "neutral"
    overall-chance: 100
    drops: ......etc...

entities:
  - entity: WITHER_SKELETON
    overall-chance: 100 # = 100% overall chance for any items in this creeper-specific drop table to be processed
    
    drops:
      - material: "CYAN_DYE"
        chance: 5 # 5% chance to drop
        name: "&3Custom Drop"
        amount: 1-2
        min-level: 75
        max-level: 100
        custom-model-data: 123
        no-multiplier: true
        no-spawner: true
        priority: 8
        max-drops-in-group: 2
        item-flags: ['HIDE_ATTRIBUTES']
        drop-group-id: 'powder'
        chunk-kill-limited: true 
        durability-loss: 10
        enchantments:
          UNBREAKING: 1
        overrides-vanilla-drops: false
        permissions: ['someplugin.class.wizard']
        formula-condition: "between(%entity_max_health%, 12, 34) && between(%player_exp_to_level%, 12, 34)"
        cause-of-death: ["PLAYER"]

      - command: "/say Something happened with a creeper!"
        run: ["ON_SPAWN", "ON_DEATH"]

      - command: "/say It has spawned in!"
        run: "ON_SPAWN"
        delay: 1

      - command: ["/say Farewell, Creeper...", "/say Shall you form your craters in the grounds of hell..."]
        run: "ON_DEATH"

drop-tables:
  - drop-table: 'Brain-Eaters'
    entities:
      in-list: ['ZOMBIE', 'HUSK', 'DROWNED']
    drops:
      - material: "NETHERITE_SWORD"
        chance: 0.5 # 0.5%
        name: "&cLegendary Broadsword"
        amount: 1-5
        min-level: 95
        max-level: 100

Removed Features From LM3 -> LM4

Only Drop If Equipped

Only Drop If Equipped is redundant, since if the drop was designated
to be only equipped, set the equipped chance to 1 and set the chance
of the item being applied to the entity to whatever you like.
Otherwise you are using two stacked chances and an extra setting for
no reason. :)

only-drop-if-equipped: false

Unchanged; same as LM3

amount: 32
name: '&dBlazed Pearl Broadsword'
lore: ['&f&oForged from Wither ashes.']
priority: 5
nbt-data: ""
delay: 0
external-amount: 1

# **Note:** LM4, unlike LM3, does not add the `levelledmobs.permission.` prefix.
permission: ['vip']

Sections

Added entities: and groups: sections which sit alongside the drop-tables: section.

Generic Formatting Changes

No behavioural changes - just keeping the key name formatting consistent.

LM3:

minLevel: 12
maxLevel: 34
custommodeldata: 123
nomultiplier: true
nospawner: false
maxdropgroup: 1
item_flags: ''
groupid: ''

LM4:

min-level: 12
max-level: 34
custom-model-data: 123
no-multiplier: true
no-spawner: false
max-drops-in-group: 1
item_flags: ['HIDE_ATTRIBUTES']
drop-group-id: ''

Root Item Section

LM4 removes the material node acting as a parent for the rest of the drop's nodes, as that is redundant and promotes indentation errors.

LM3:

- DIAMOND_SWORD:
    name: 'Sword of a Thousand Truths'

LM4:

- material: "DIAMOND_SWORD"
  name: 'Sword of a Thousand Truths'

Chances

About: Chance that an item will drop.

Demonstrating a 15% chance.

LM3:

chance: 0.15 

LM4:

chance: 15

Chunk Kill Count

About: The item will be limited by LM's chunk kill count system.

LM3:

use-chunk-kill-max: true

LM4:

chunk-kill-limited: true 

Durability Loss (Damage)

About: Represents a decrease in durability

LM3:

damage: 10

LM4:

durability-loss: 10

Equipment

LM3:

equipped: 1.0
equip-offhand: true

LM4:

equip:

    # Chance to equip or otherwise act as a drop
    chance: 0.6

    # if equipment-slots is specified then the item WILL be equipped, just a matter of 'where?'.
    # LM will attempt to put the item in any of the slots, in order.
    # Equipped items will be limited to their material's stack size and will not use any overflow logic.
    allowed-slots: ['MAIN_HAND', 'OFF_HAND', 'HELMET', 'CHESTPLATE', 'LEGGINGS', 'BOOTS']

Enchantments

LM3:

enchantments:
    ENCHANTMENT: X
enchantments:
    ENCHANTMENT:
        shuffle: false
        default: 1
        X: 0.5

LM4:

Removed Shuffle and Default - deemed unnecessary.

enchantments:
  - enchantment: Sharpness
     strength: 5
     chance: 75

Overrides Vanilla Drops

LM3:

override: true

LM4:

overrides-vanilla-drops: true

Overall Chances and Permissions

Note: LM4, unlike LM3, does not add the levelledmobs.permission. prefix.

LM3:

CREEPER:
  - DIAMOND_SWORD:
        overall_chance: 0.750112
        overall_permission: ['vip']
ZOMBIE:
  - DIAMOND_SWORD:
        overall_chance: 0.2357
        overall_permission: ['vip']

LM4:

CREEPER:
    overall-chance: 75.0112 # = 75.0112% overall chance for any items to be processed
    overall-permissions: ['vip']
    drops:
      - material: "NETHERITE_SWORD"

ZOMBIE:
    overall-chance: 23.57   # = 23.57% overall chance for any items to be processed
    overall-permissions: ['vip']
    drops:
      - material: "APPLE"

Permissions

Added a plural in LM4 (permission -> permissions).

Run On Spawn/Death

This is for the commands feature

LM3:

run-on-spawn: true
run-on-death: true

LM4:

# multi-value variant
run: ["ON_SPAWN", "ON_DEATH"]

# single-value variant
run: "ON_SPAWN"
run: "ON_DEATH"

Formula Conditions

LM3:

min-player-level: 12
max-player-level: 34
player-level-variable: '%player_exp_to_level%'

LM4:

Basically a custom formula, when evaluated if it equals 0 then LM treats it as "false",
when it is a value that is not 0 then it is treated as "true".

The 'between' function accepts 3 parameters, it is used to check if param 1 is between
param 2 (inclusive) and 3 (inclusive).

formula-condition: "between(%entity_some_placeholder_here%, 12, 34) && between(%player_exp_to_level%, 12, 34)"

Cause of Death & Player-Caused

LM3:

cause-of-death: ['']
player-caused: true

LM4:

# This will be the default value
cause-of-death: ["PLAYER"]

External Type

LM3:

type: 'LM items type here.'

LM4:

external-type: 'LM items type here.'

@lokka30 lokka30 changed the title LM4 Buffs System LM4 Buffs & CustomDrops Nov 13, 2022
@lokka30 lokka30 changed the title LM4 Buffs & CustomDrops LM4 Buffs System Nov 22, 2022
@lokka30
Copy link
Member Author

lokka30 commented Jan 2, 2023

Shield breaker feature is on-hold due to the lack of required API. PaperMC/Paper#8751

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: normal Normal priority status: confirmed Confirmed by a maintainer type: improvement Add or adjust a feature
Projects
None yet
Development

No branches or pull requests

1 participant