Skip to content

afterEnter event not triggering for zone #2936

Closed
@KaQn

Description

@KaQn

Priority

Medium

Area

  • Datapack
  • Source
  • Map
  • Other

What happened?

Issue: afterEnter event not triggering in custom zone

I encountered an issue while setting up a custom zone for my server. I wanted to apply a condition to the player upon entering a specific area, but I noticed that the afterEnter event wasn’t being triggered, despite the setup being correct.

Upon investigating, I found that removing the true from the following line made the afterEnter event work as expected:

local afterEnter = EventCallback("ZoneEventAfterEnter", true)

You can easily testthis by adding a print statement in the following code:

function afterEnter.zoneAfterCreatureEnter(zone, creature)
print("After enter executes")
if zone ~= self.zone then
return true
end
self.afterEnter(zone, creature)
end

This suggests there might be an issue with the skipDuplicationCheck boolean.

Removing the true causes a series of other problems in the console:

image

What OS are you seeing the problem on?

Windows

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority: MediumThis issue may be impactful and needs some attention.Status: Pending TestThis PR or Issue requires more testingType: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions