Skip to content

Conversation

@EllaCoat
Copy link
Contributor

@EllaCoat EllaCoat commented Jan 6, 2026

Fix #2215

ใกใ‚‡ใฃใจใ‹ใชใ‚Š้ฉๅฝ“ใช็›ดใ—ๆ–นใง็”ณใ—่จณใชใ„ใŒใ€ใจใ‚Šใ‚ใˆใšๅ‹•ใใ‚ˆใ†ใซใฏใ—ใฆใฟใŸใ€‚
ใ‚‚ใฃใจ้•ใ†ใ‚„ใ‚Šๆ–นใ‚’ใ—ใฆๆฌฒใ—ใ„ใจใ‹ใŒใ‚ใ‚Œใฐใ€ๆ˜ฏ้žๆ„่ฆ‹ใ‚’ใ€‚

Copilot AI review requested due to automatic review settings January 6, 2026 21:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes issue #2215 where mainhand and offhand artifacts were being triggered simultaneously when only one should activate. The solution prevents the offhand artifact from firing when a mainhand artifact is used.

Key changes:

  • Added logic to detect mainhand usage and set a flag in storage
  • When mainhand is used, the offhand artifact ID is set to -2 (disabled)
  • Added cleanup logic to reset the UseMainhand flag after processing

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
TheSkyBlessing/data/asset_manager/functions/artifact/triggers/shot.mcfunction Added mainhand/offhand conflict prevention for bow-based artifacts
TheSkyBlessing/data/asset_manager/functions/artifact/triggers/click.carrot.mcfunction Added mainhand/offhand conflict prevention for carrot-on-a-stick artifacts

๐Ÿ’ก Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 11 to 18
# ใƒกใ‚คใƒณใƒใƒณใƒ‰็ฅžๅ™จใ‚’ไฝฟ็”จใ—ใฆใ„ใ‚‹ใชใ‚‰ใ‚นใƒˆใƒฌใƒผใ‚ธใซใƒใ‚งใƒƒใ‚ฏใ‚’ๅ…ฅใ‚Œใ‚‹
execute if data storage asset:artifact Argument{AutoSlot:"mainhand"} run data modify storage asset:context UseMainhand set value 1b

# ใ‚คใƒ™ใƒณใƒˆ็™บ็ซๅ‰ใซๅฎŸ่กŒใ™ใ‚‹ใ‚„ใค
function asset_manager:artifact/data/new/set_to_current

# ใƒกใ‚คใƒณใƒใƒณใƒ‰็ฅžๅ™จใ‚’ไฝฟ็”จใ—ใฆใ„ใ‚‹ใชใ‚‰ใ‚ชใƒ•ใƒใƒณใƒ‰ใฎIDใ‚’ๅ‰Š้™ค
execute if data storage asset:context UseMainhand run data modify storage asset:context id.offhand set value -2
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The mainhand/offhand checking logic (lines 11-18) is duplicated across multiple trigger files. Consider extracting this into a shared function to improve maintainability and reduce code duplication. This would make future updates easier and reduce the risk of inconsistencies.

Copilot uses AI. Check for mistakes.

# ใ‚คใƒ™ใƒณใƒˆ็™บ็ซๅ‰ใซๅฎŸ่กŒใ™ใ‚‹ใ‚„ใค
function asset_manager:artifact/data/new/set_to_current

Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

This line contains trailing whitespace. Remove the spaces at the end of the line.

Suggested change

Copilot uses AI. Check for mistakes.

# ใ‚คใƒ™ใƒณใƒˆ็™บ็ซๅ‰ใซๅฎŸ่กŒใ™ใ‚‹ใ‚„ใค
function asset_manager:artifact/data/new/set_to_current

Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

This line contains trailing whitespace. Remove the spaces at the end of the line.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines 11 to 18
# ใƒกใ‚คใƒณใƒใƒณใƒ‰็ฅžๅ™จใ‚’ไฝฟ็”จใ—ใฆใ„ใ‚‹ใชใ‚‰ใ‚นใƒˆใƒฌใƒผใ‚ธใซใƒใ‚งใƒƒใ‚ฏใ‚’ๅ…ฅใ‚Œใ‚‹
execute if data storage asset:artifact Argument{AutoSlot:"mainhand"} run data modify storage asset:context UseMainhand set value 1b

# ใ‚คใƒ™ใƒณใƒˆ็™บ็ซๅ‰ใซๅฎŸ่กŒใ™ใ‚‹ใ‚„ใค
function asset_manager:artifact/data/new/set_to_current

# ใƒกใ‚คใƒณใƒใƒณใƒ‰็ฅžๅ™จใ‚’ไฝฟ็”จใ—ใฆใ„ใ‚‹ใชใ‚‰ใ‚ชใƒ•ใƒใƒณใƒ‰ใฎIDใ‚’ๅ‰Š้™ค
execute if data storage asset:context UseMainhand run data modify storage asset:context id.offhand set value -2
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

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

The mainhand/offhand checking logic (lines 11-18) is duplicated across multiple trigger files. Consider extracting this into a shared function to improve maintainability and reduce code duplication. This would make future updates easier and reduce the risk of inconsistencies.

Copilot uses AI. Check for mistakes.
@EllaCoat EllaCoat force-pushed the fix/ella_artifact_offhand branch from 8902f37 to c5f4226 Compare January 6, 2026 21:53
@ChenCMD ChenCMD merged commit 6e09c3c into master Jan 25, 2026
2 checks passed
@ChenCMD ChenCMD deleted the fix/ella_artifact_offhand branch January 25, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants