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

Added util methods to retrieve targeting block / entity directly #945

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

Prunoideae
Copy link
Contributor

Description

Added getTargetBlock and getTargetEntity for HighlightKubeEvent so users can get the targeting block / entities in a convenient way and apply additional logic without ray tracing.

Example Script

ClientEvents.highlight(event => {
    let { player, targetBlock } = event

    if (targetBlock == null || !targetBlock.hasTag("c:ores")) return // So it will only highlight ore blocks

    event.addTargetBlock('gold')
    event.cancelBlockHighlight()
})

@LatvianModder LatvianModder merged commit 9a8ac19 into KubeJS-Mods:main Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants