Skip to content

EffForceAttack Damage Entity By Amount #7878

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

Open
wants to merge 5 commits into
base: dev/feature
Choose a base branch
from

Conversation

Absolutionism
Copy link
Contributor

Problem

No support for having an entity damage another entity by a specific amount.

Solution

Updates EffForceAttack by adding 2 new patterns to add this support

Testing Completed

CODE
command /emptyhand:
	trigger:
		spawn a zombie at test-location:
			set {_attacker} to entity
		spawn a villager at test-location:
			set {_victim} to entity
		make {_attacker} attack {_victim}
		clear entity within {_attacker}
		clear entity within {_victim}

command /swordhand:
	trigger:
		spawn a zombie at test-location:
			set {_attacker} to entity
			set the tool of {_attacker} to a netherite sword
		spawn a villager at test-location:
			set {_victim} to entity
		make {_attacker} attack {_victim}
		clear entity within {_attacker}
		clear entity within {_victim}

command /damage [<num: number = 1>]:
	trigger:
		spawn a zombie at test-location:
			set {_attacker} to entity
		spawn a villager at test-location:
			set {_victim} to entity
		make {_attacker} damage {_victim} by {_num}
		clear entity within {_attacker}
		clear entity within {_victim}

on damage:
	broadcast "Damage %damage%"
	broadcast "Final: %final damage%"
	broadcast "Attacker: %attacker%"

Completes: none
Related: none

@Absolutionism Absolutionism requested a review from a team as a code owner May 18, 2025 22:55
@Absolutionism Absolutionism requested review from cheeezburga and erenkarakal and removed request for a team May 18, 2025 22:55
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label May 18, 2025
Copy link
Member

@sovdeeth sovdeeth left a comment

Choose a reason for hiding this comment

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

should have some test scripts

@sovdeeth sovdeeth added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label May 19, 2025
@Absolutionism
Copy link
Contributor Author

should have some test scripts

I did attempt making a test script but there seemed to be some discrepancies for the test (quickTest) versus a started up server (skriptTestDev)
Such as, having a zombie equipped with a netherite sword was still dealing the same amount of damage as with no sword, on the test. But actually starting it up and testing manually it worked fine.

So I took advantage of your new PR template to provide the code I used to test manually.

@Absolutionism Absolutionism requested a review from sovdeeth May 19, 2025 15:27
@sovdeeth
Copy link
Member

I did attempt making a test script but there seemed to be some discrepancies for the test (quickTest) versus a started up server (skriptTestDev)
Such as, having a zombie equipped with a netherite sword was still dealing the same amount of damage as with no sword, on the test. But actually starting it up and testing manually it worked fine.

Test what does work, though. It's understandable that it might not update items but you should be able to test the newly added syntax just fine.

@Absolutionism Absolutionism requested a review from sovdeeth May 20, 2025 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request, an issue about something that could be improved, or a PR improving something. needs reviews A PR that needs additional reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants