Skip to content

Conversation

@Absolutionism
Copy link
Contributor

@Absolutionism Absolutionism commented Oct 2, 2025

Problem

Skript does not have support for Blocking Components, otherwise known as BlocksAttacks. Skript should include this since it's vanilla.

Solution

Adds BlockingWrapper that extends ComponentWrapper and handles modifying data of the underlying BlocksAttacks component.
Adds DamageFunctionWrapper that wraps ItemDamageFunction. This handles changing data of the wrapped ItemDamageFunction. This can be created with a parenting BlockingWrapper to specify that any changes made to the underlying ItemDamageFunction should take place on the BlockingWrapper. Using the wrapper to change the ItemDamageFunction of any BlockingWrapper should not presume to be the parent, as it can and should be used on multiple BlockingWrappers.
Adds DamageReductionWrapper that wraps DamageReduction. This handles changing data of the wrapped DamageReduction. This can be created with a parenting BlockingWrapper to specify that any changes made to the underlying DamageReduction should take place on the BlockingWrapper. Using the wrapper to change the DamageReductions of any BlockingWrapper should not presume to be the parent, as it can and should be used on multiple BlockingWrappers.

Adds builders for BlocksAttacks, ItemDamageFunction, and DamageReduction as there was no way to convert an existing finalized object back into the builder provided by Paper.

Adds BlockingExperimentalSyntax for all related syntax elements. This component, just like every other, are experimental.

Adds all syntax elements that correlate to retrieving and modifying BlockingWrappers, DamageFunctionWrappers, and DamageReductionWrappers

Testing Completed

BlockingComponents.sk

Supporting Information

N/A


Completes: none
Related: none

Absolutionism and others added 30 commits November 4, 2024 01:39
…leComponents

# Conflicts:
#	src/main/java/ch/njol/skript/Skript.java
#	src/main/resources/lang/default.lang
…leComponents

# Conflicts:
#	src/main/java/ch/njol/skript/util/slot/EquipmentSlot.java
…leComponents

# Conflicts:
#	src/main/java/ch/njol/skript/Skript.java
#	src/main/java/ch/njol/skript/bukkitutil/SoundUtils.java
#	src/main/resources/lang/default.lang
…leComponents

# Conflicts:
#	src/main/java/ch/njol/skript/Skript.java
#	src/main/java/ch/njol/skript/util/slot/EquipmentSlot.java
#	src/main/resources/lang/default.lang
…leComponents

# Conflicts:
#	src/main/resources/lang/default.lang
…leComponents

# Conflicts:
#	src/main/java/ch/njol/skript/registrations/Feature.java
#	src/main/resources/lang/default.lang
Absolutionism and others added 19 commits July 18, 2025 21:13
…Component

# Conflicts:
#	src/main/java/ch/njol/skript/Skript.java
#	src/main/java/ch/njol/skript/classes/data/BukkitClasses.java
#	src/main/java/ch/njol/skript/lang/function/Function.java
#	src/main/java/ch/njol/skript/registrations/Feature.java
#	src/main/java/ch/njol/skript/util/ItemSource.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/ComponentUtils.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/ComponentWrapper.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/ItemComponentModule.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/EquippableModule.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/EquippableWrapper.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/CondEquipCompDamage.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/CondEquipCompDispensable.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/CondEquipCompInteract.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/CondEquipCompShearable.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/CondEquipCompSwapEquipment.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/EffEquipCompDamageable.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/EffEquipCompDispensable.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/EffEquipCompInteract.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/EffEquipCompShearable.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/EffEquipCompSwapEquipment.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompCameraOverlay.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompEntities.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompEquipSound.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompModel.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompShearSound.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquipCompSlot.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprEquippableComponent.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprSecBlankEquipComp.java
#	src/main/java/org/skriptlang/skript/bukkit/itemcomponents/generic/ExprItemCompCopy.java
#	src/main/resources/lang/default.lang
@Absolutionism Absolutionism requested a review from a team as a code owner October 2, 2025 02:59
@Absolutionism Absolutionism added the feature Pull request adding a new feature. label Oct 2, 2025
@Absolutionism Absolutionism requested review from Burbulinis and erenkarakal and removed request for a team October 2, 2025 02:59
@Absolutionism Absolutionism moved this to In Review in 2.14 Releases Oct 2, 2025
@Absolutionism Absolutionism added the 2.14 Targeting a 2.14.X version release. label Nov 2, 2025
infoBuilder(
ExprBlockCompBypass.class,
DamageType.class,
"[blocking] damage type bypass[es]",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"[blocking] damage type bypass[es]",
"bypassing damage type[s]",


@Name("Blocking Component - Damage Type Bypass")
@Description("""
The damage type that can bypass when the item is blocking.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The damage type that can bypass when the item is blocking.
The damage type that can bypass the damage reduction from blocking with this item.


@Name("Blocking Component - Delay Time")
@Description("""
The amount of time before an item can block an attack after starting to block.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this affect the blocking animation speed? If so I think that should be mentioned. No clue if it does.

public static void register(SyntaxRegistry registry) {
registry.register(
SyntaxRegistry.EXPRESSION,
infoBuilder(ExprBlockCompDelay.class, Timespan.class, "blocking delay time[s]", "blockingcomponents", true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
infoBuilder(ExprBlockCompDelay.class, Timespan.class, "blocking delay time[s]", "blockingcomponents", true)
infoBuilder(ExprBlockCompDelay.class, Timespan.class, "blocking delay [time[s]]", "blockingcomponents", true)

@Example("set the item damage function of {_item} to a custom damage function")
@RequiredPlugins("Minecraft 1.21.5+")
@Since("INSERT VERSION")
public class ExprBlockCompDamageFunction extends SimplePropertyExpression<BlockingWrapper, DamageFunctionWrapper> implements BlockingExperimentalSyntax {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove concept of damage function as discussed

infoBuilder(
ExprReductionDamageTypes.class,
DamageType.class,
"[damage] reduction damage types",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"[damage] reduction damage types",
"(reduced|blocked) damage types",

set {_reductions::*} to the damage reductions of {_item}
set {_amounts::*} to the reduction factor amounts of {_reductions::*}
""")
@Example("set the damage reduction factor of (the damage reductions of {_item}) to 0.5")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@Example("set the damage reduction factor of (the damage reductions of {_item}) to 0.5")
@Example("set the damage reduction factor of (the damage reductions of {_item}) to 50%")

infoBuilder(
ExprReductionFactor.class,
Float.class,
"[damage] reduction factor [amount[s]]",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"[damage] reduction factor [amount[s]]",
"(proportional|percentage) [damage] reduction[s]",


@Name("Blank Blocking Component")
@Description("""
Gets a blank blocking component.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to mention the defaults! Also not sure this should be "blank" if it's full of default values?


@Name("Custom Damage Reduction")
@Description("""
Gets a custom damage reduction.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaults?

@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.14 Targeting a 2.14.X version release. feature Pull request adding a new feature. needs reviews A PR that needs additional reviews

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants