- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
[Bug]: lse py用settimeout函数控制台报错
e.g:
def on_enable():
    cache={}
    def on_useitemon(player:LLSE_Player,item:LLSE_Item,block:LLSE_Block,side,pos:FloatPos):
        if item.type=="minecraft:wooden_axe":
            if player.xuid not in cache.keys():
                mc.broadcast(f"{player.name}")
                cache[player.xuid]=True
                def _timeout():
                    cache.pop(player.xuid)
                #setTimeout(_timeout,500)
    mc.listen("onUseItemOn",on_useitemon)
mc.listen("onServerStarted",on_enable)在右键小木斧时候不会报错
def on_enable():
    cache={}
    def on_useitemon(player:LLSE_Player,item:LLSE_Item,block:LLSE_Block,side,pos:FloatPos):
        if item.type=="minecraft:wooden_axe":
            if player.xuid not in cache.keys():
                mc.broadcast(f"{player.name}")
                cache[player.xuid]=True
                def _timeout():
                    cache.pop(player.xuid)
                setTimeout(_timeout,500)
    mc.listen("onUseItemOn",on_useitemon)
mc.listen("onServerStarted",on_enable)To Reproduce
如文
Expected behavior
应该不会报错
Screenshots
No response
Platform
windows 11
BDS Version
1.21.50-10.766+37da480
LeviLamina Version
1.0.0-rc.3+cf3c57929.
LegacyScriptEngine Version
legacy-script-engine-python v0.9.0
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
