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

Warden info #1

Open
Madis0 opened this issue Jun 14, 2022 · 3 comments
Open

Warden info #1

Madis0 opened this issue Jun 14, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Madis0
Copy link

Madis0 commented Jun 14, 2022

Could you add some statistics about the warden, so the user knows how angry it is or how likely it is to spawn?

As far as I know, those values are server-side, but it could be estimated based on the sound events the client gets.

Disclamer: this request is a bit shameless because I actually want to add this to my mod, but just haven't been able to figure out, how. Obviously this would benefit your users as well and I would follow your license when forking.

@Flamarine Flamarine self-assigned this Jun 15, 2022
@Flamarine
Copy link
Member

The times the sculk shrieker shrieked, aka warning level, is specific to each player, however I tried to get the value but failed.
And the anger of warden can be obtained directly from WardenEntity and works quite well.
The only thing I cannot figure out is the estimated time until warden despawn. There seems to be no way to get this.

@Madis0
Copy link
Author

Madis0 commented Jun 15, 2022

The only thing I cannot figure out is the estimated time until warden despawn. There seems to be no way to get this.

According to

After sixty seconds of being "calm" and not detecting any vibrations, if the warden is on the ground, it burrows back into the ground and despawns.

it should be 60 seconds (1200 ticks) of the warden existing and the anger level being calm. Some kind of a timer perhaps?

@Flamarine Flamarine added enhancement New feature or request help wanted Extra attention is needed labels Jun 15, 2022
@Madis0
Copy link
Author

Madis0 commented Aug 11, 2022

So, I now implemented the warden anger level to my mod and got some notes for you if you still want to do it.

  • The anger types can be gotten like warden.getAngriness() == Angriness.ANGRY and warden.getAngriness() == Angriness.AGITATED, no need to hardcode the values.
  • I was not able to calculate the despawn time as I couldn't get the timer to work and it expected additional variables anyway (the sniffing and vibration detections affect it, so these need to be counted for as well).
    • I think the most accurate despawn time is in warden.getBrain().getMemory(MemoryModuleType.DIG_COOLDOWN), but that seemed to be available server-side only to me. Maybe something can be done with warden.getDespawnCounter() though.
  • I didn't try the sculk shriekers at this time.
  • I got inspired by your code but the logic turned out to be so different that I didn't use it 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants