Changed placeholder format, improved hot potato books

This commit is contained in:
Auxilor
2024-07-17 18:04:40 +01:00
parent 5c62b3b467
commit a17c412a5c
3 changed files with 9 additions and 49 deletions

View File

@@ -63,7 +63,7 @@ class EcoScrollsPlugin : LibreforgePlugin() {
} }
PlaceholderManager.registerPlaceholder( PlaceholderManager.registerPlaceholder(
object : DynamicPlaceholder(plugin, Pattern.compile("scroll_([a-z0-9_]+)_([a-zA-Z0-9_]+)")) { object : DynamicPlaceholder(plugin, Pattern.compile("scroll_([a-z0-9_]+):([a-zA-Z0-9_]+)")) {
override fun getValue(args: String, context: PlaceholderContext): String? { override fun getValue(args: String, context: PlaceholderContext): String? {
val matcher = pattern.matcher(args) val matcher = pattern.matcher(args)

View File

@@ -77,8 +77,8 @@ lore:
- "&6Example Scroll" - "&6Example Scroll"
# Item placeholders for dynamic lore in plugins like EcoItems # Item placeholders for dynamic lore in plugins like EcoItems
# The placeholder is %ecoscrolls_scroll_<scroll>_<placeholder>%, e.g. # The placeholder is %ecoscrolls_scroll_<scroll>:<placeholder>%, e.g.
# %ecoscrolls_scroll_example_bonus% # %ecoscrolls_scroll_example:bonus%
placeholders: placeholders:
bonus: "%level% * 2" bonus: "%level% * 2"

View File

@@ -7,17 +7,11 @@
# The name of the scroll # The name of the scroll
name: "&cHot Potato Book" name: "&cHot Potato Book"
# The max level of the scroll
max-level: 10 max-level: 10
# The amount of times the scroll can be used
max-uses: 1 max-uses: 1
# Options for the physical scroll item
item: item:
item: book unbreaking:1 hide_enchants item: book unbreaking:1 hide_enchants
# Name and lore can use %uses%, %max_uses%, and %uses_left% placeholders
name: "&cHot Potato Book" name: "&cHot Potato Book"
lore: lore:
- "&7When inscribed on armor, grants" - "&7When inscribed on armor, grants"
@@ -29,69 +23,37 @@ item:
- "&7This can be inscribed up to &a10 &7times" - "&7This can be inscribed up to &a10 &7times"
- "&7on an item!" - "&7on an item!"
# Options for crafting, read here: https://plugins.auxilor.io/all-plugins/the-item-lookup-system#crafting-recipes
craftable: false craftable: false
recipe: [ ] recipe: [ ]
# Options for inscribing items with the scroll
inscription: inscription:
# The conditions required to inscribe the item
# not-met-effects will run if someone tries to inscribe the item without meeting the conditions
conditions: [ ] conditions: [ ]
# The effects that will be run when the item is inscribed
# If your scroll works by modifying the item (e.g. adding enchantments, changing durability),
# then put those effects here.
effects: [ ] effects: [ ]
# Read https://plugins.auxilor.io/all-plugins/prices
# The price to inscribe the item
price: price:
value: 100 value: 100
type: coins type: coins
display: "&e%value% coins" display: "&e%value% coins"
# The formula to multiply the price depending on the level.
# The %level% placeholder is the *current* level of the scroll
price-level-multiplier: "1 + %level% * 0.5" price-level-multiplier: "1 + %level% * 0.5"
# If the scroll can be applied to items via drag-and-drop drag-and-drop: false
drag-and-drop: true
# If the scroll can be applied to items via the inscription table
inscription-table: true inscription-table: true
# The items that the scroll can be applied to, see targets.yml
targets: targets:
- sword - sword
- axe - axe
- armor - armor
# The conflicts that the scroll has with other scrolls
conflicts: [ ]
# The scroll(s) that must be applied to the item before this scroll can be applied
requirements: [ ]
# If inscribing this scroll should remove the required scrolls
remove-requirements: false
# The lore added to items when inscribed with the scroll
lore: [ ]
# Item placeholders for dynamic lore in plugins like EcoItems
# The placeholder is %ecoscrolls_scroll_<scroll>_<placeholder>%, e.g.
# %ecoscrolls_scroll_example_bonus%
placeholders: placeholders:
# For EcoItems items, use %ecoscrolls_scroll_hot_potato_book_defense% in lore # For EcoItems items, use %ecoscrolls_scroll_hot_potato_book:defense% in lore
defense: " &8(&e{^{%level% * 2}}&8)" defense: "&8(&e+{^{%level% * 2}}&8)"
# Same as above, but for health / strength / crit_damage # Same as above, but for health / strength / crit_damage
health: " &8(&e{^{%level%}}&8)" health: "&8(&e+{^{%level%}}&8)"
strength: " &8(&e{^{%level% * 2}}&8)" strength: "&8(&e+{^{%level% * 2}}&8)"
crit_damage: " &8(&e{^{%level% * 4}}&8)" crit_damage: "&8(&e+{^{%level% * 4}}&8)"
# Read https://plugins.auxilor.io/effects/configuring-an-effect
# The effects for the scroll to give
effects: effects:
# Armor effects # Armor effects
- id: add_stat - id: add_stat
@@ -129,6 +91,4 @@ effects:
args: args:
slot: mainhand slot: mainhand
# Read https://plugins.auxilor.io/effects/configuring-a-condition
# The conditions for the scroll to work
conditions: [ ] conditions: [ ]