网易我的世界论坛

标题: 关于命名空间和getComponent [打印本页]

作者: 松饼脑袋    时间: 2020-12-27 18:58
标题: 关于命名空间和getComponent
        def OnProjectileDoHitEffectEvent(self, args):
                type = args["hitTargetType"]
                entityId = args["id"]
                basecomponent = serverApi.GetComponent(entityId,"muffinhead","custom_arrow")
                if basecomponent != None:
                        if type == "BLOCK":
                                self.DestroyEntity(entityId)
                                print "1"
                else:
                        basecomponent = serverApi.GetComponent(entityId,"muffinhead","custom_arrow")
                        print basecomponent


这里是get实体  实体ID有了 命名空间和名字 我配置文件写的是
identifier:muffinhead:custom_arrow
为什么这个一直输出None  [attach]1328127[/attach]




欢迎光临 网易我的世界论坛 (https://mc.netease.com/) Powered by Discuz! X3.3