迷你世界api 系统事件

游戏活动管理
只需添加需要监视的事件,而无需创建事件对象,如下所示:

--Game Event---
ScriptSupportEvent:registerEvent([=[Game.Start]=], Game_StartGame)
ScriptSupportEvent:registerEvent([=[Game.Run]=], Game_Update)
ScriptSupportEvent:registerEvent([=[Game.End]=], Game_GameOver)
--Player Event---
ScriptSupportEvent:registerEvent([=[Player.Die]=], Player_Dead)
ScriptSupportEvent:registerEvent([=[Player.Revive]=], Player_Revive)
ScriptSupportEvent:registerEvent([=[Player.AddItem]=], BackPack_AddItem)
--Block Event---
ScriptSupportEvent:registerEvent([=[Block.Add]=], Block_Add)
ScriptSupportEvent:registerEvent([=[Block.DestroyBy]=], Block_Destroy)
ScriptSupportEvent:registerEvent([=[Block.Trigger]=], Block_Trigger)

游戏事件类型和说明
没有。 事件类型 描述
1个 世界大赛 地图中的相关事件
2 逻辑事件 游戏逻辑相关事件
3 玩家事件 玩家相关事件
4 生物事件 生物相关事件
5 封锁事件 阻止相关事件
6 项目事件 项目相关事件
7 粒子事件 粒子相关事件
世界大赛(世界)
名称 描述 参数
天气变化 天气变化 没有
Backpack.ItemTakeOut 容器有物品输出 {blockid,x,y,z,itemid,itemnum}1.1+
Backpack.ItemPutIn 容器有物品输入 {blockid,x,y,z,itemid,itemnum}1.1+
Backpack.ItemChange 背包栏的变更 {blockid,x,y,z,itemid,itemnum}
世界事件相关示例:

--Write a function, just named when the Change of weather will perform this function
local function Weather_Changed()Chat:sendSystemMsg("Incident: Change of weather")
end
--Registered listeners, Change the function of the Executive Weather_Changed when weather
--The first parameter is listening event, the second parameter Weather_Changed function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Weather.Changed]=],Weather_Changed)
--Write a function, just named when the Change of backpack bar will perform this function
local function Backpack_ItemChange(event)Chat:sendSystemMsg("Incident: Change of backpack bar")Chat:sendSystemMsg("Parameter blockid as:" .. event.blockid)Chat:sendSystemMsg("Parameter x is:" .. event.x)Chat:sendSystemMsg("Parameter y is:" .. event.y)Chat:sendSystemMsg("The parameter z as:" .. event.z)Chat:sendSystemMsg("Parameter itemid as:" .. event.itemid)Chat:sendSystemMsg("Parameter itemnum as:" .. event.itemnum)
end
--Registered listeners, Change of backpack bar when a function execution Backpack_ItemChange
--The first parameter is listening event, the second parameter Backpack_ItemChange function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Backpack.ItemChange]=],Backpack_ItemChange)

逻辑事件相关示例:

--Write a function, just named, when Any player is defeated will perform this function
local function Game_AnyPlayer_Defeat(event)Chat:sendSystemMsg("Incident: Any player is defeated")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners when the function execution Game_AnyPlayer_Defeat Any player is defeated
--The first parameter is listening event, the second parameter Game_AnyPlayer_Defeat function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.AnyPlayer.Defeat]=],Game_AnyPlayer_Defeat)
复制!
--Write a function, just named, when Any player enters game when this function is executed
local function Game_AnyPlayer_EnterGame(event)Chat:sendSystemMsg("Incident: Any player enters game")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners, do Game_AnyPlayer_EnterGame function Any player enters game when
--The first parameter is listening event, the second parameter Game_AnyPlayer_EnterGame function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.AnyPlayer.EnterGame]=],Game_AnyPlayer_EnterGame)
复制!
--Write a function, just named, when Any player leaves game will perform this function
local function Game_AnyPlayer_LeaveGame(event)Chat:sendSystemMsg("Incident: Any player leaves game")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners, do Game_AnyPlayer_LeaveGame function Any player leaves game time
--The first parameter is listening event, the second parameter Game_AnyPlayer_LeaveGame function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.AnyPlayer.LeaveGame]=],Game_AnyPlayer_LeaveGame)
复制!
--Write a function, just named, when Any player wins when this function is executed
local function Game_AnyPlayer_Victory(event)Chat:sendSystemMsg("Incident: Any player wins")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners when the function execution Game_AnyPlayer_Victory Any player wins
--The first parameter is listening event, the second parameter Game_AnyPlayer_Victory function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.AnyPlayer.Victory]=],Game_AnyPlayer_Victory)
复制!
--Write a function, just named, when Game over will perform this function
local function Game_End()Chat:sendSystemMsg("Incident: Game over")
end
--Registered listeners, do Game_End function when Game over
--The first parameter is listening event, the second parameter Game_End function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.End]=],Game_End)
复制!
--Write a function, just named, when the World time is when will perform this function [n]
local function Game_Hour(event)Chat:sendSystemMsg("Incident: World time is [n]")Chat:sendSystemMsg("Parameter hour as:" .. event.hour)
end
--Registered listeners, World time is executed Game_Hour function when [n]
--The first parameter is listening event, the second parameter Game_Hour function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.Hour]=],Game_Hour)
复制!
--Write a function, just named, when Start game will perform this function
local function Game_Load()Chat:sendSystemMsg("Incident: Start game")
end
--Registered listeners, do Game_Load function when Start game
--The first parameter is listening event, the second parameter Game_Load function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.Load]=],Game_Load)
复制!
--Write a function, just named, when the Game is running will perform this function
--This event will be triggered once every 50ms, the internal function call interface should not be sending messages, or chat box will be scraper
local function Game_Run()--Chat:sendSystemMsg("Incident: Game is running")--Every 50ms to homeowner output increased 1 until the blood is not less than 100local result,hp=Player:getAttr(0,2) - Get current health Homeownersif hp<100 then-- if the blood is less than 100Player:setAttr(0,2, hp + 1) - adding to the blood a homeownerend
end
--Registered listeners, do Game_Run function when Game is running
--The first parameter is listening event, the second parameter Game_Run function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.Run]=],Game_Run)
复制!
--Write a function, just named, when the World time is [n] will perform this function when the second
--This event will be triggered once per second, so the internal function call interface should not be sending messages, or chat box will be scraper
local function Game_RunTime(event)--Chat:sendSystemMsg("Incident: World time is [n] second")--Chat:sendSystemMsg("Second parameter as:" .. event.second)--Per second to homeowners hungry increased by one, until the value of not less than 100 hungerlocal result,hunger=Player:getAttr(0,6) - Get the current value of a homeowner hungerif hunger<100 then-- If the value is less than 100 hungerPlayer:setAttr(0,6, hunger + 1) - a plus value to a homeowner hungerend
end
--Registered listeners, World time is [n] function when the second execution Game_RunTime
--The first parameter is listening event, the second parameter Game_RunTime function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.RunTime]=],Game_RunTime)
复制!
--Write a function, just named, when Game start will perform this function
local function Game_Start()Chat:sendSystemMsg("Incident: Game start")
end
--Registered listeners, do Game_Start function when Game start
--The first parameter is listening event, the second parameter Game_Start function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.Start]=],Game_Start)
复制!
--Write a function, just named, when Game timeout will perform this function
local function Game_TimeOver()Chat:sendSystemMsg("Incident: Game timeout")
end
--Registered listeners when Game timeout function execution Game_TimeOver
--The first parameter is listening event, the second parameter Game_TimeOver function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Game.TimeOver]=],Game_TimeOver)
复制!
--Write a function, just named, when Any change will do this time of Timer function
local function minitimer_change(event)Chat:sendSystemMsg("Incident: Any change of Timer")Chat:sendSystemMsg("Parameter timerid as:" .. event.timerid)Chat:sendSystemMsg("Parameter timername as:" .. event.timername)
end
--Registered listeners, Any change execution minitimer_change time of Timer function
--The first parameter is listening event, the second parameter minitimer_change function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[minitimer.change]=],minitimer_change)

玩家事件相关示例:

--Write a function, just named when the Add new item will perform this function
local function Player_AddItem(event)Chat:sendSystemMsg("Incident: Add new item")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)Chat:sendSystemMsg("Parameter itemid as:" .. event.itemid)Chat:sendSystemMsg("Parameter itemnum as:" .. event.itemnum)
end
--Registered listeners when the function execution Player_AddItem Add new item
--The first parameter is listening event, the second parameter Player_AddItem function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Player.AddItem]=],Player_AddItem)
复制!
--Write a function, just named when the Player enters area will perform this function
local function Player_AreaIn(event)Chat:sendSystemMsg("Incident: Player enters area")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)
end
--Registered listeners, do Player_AreaIn function when Player enters area
--The first parameter is listening event, the second parameter Player_AreaIn function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Player.AreaIn]=],Player_AreaIn)
复制!
--Write a function, just named when the Player leaves area will perform this function
local function Player_AreaOut(event)Chat:sendSystemMsg("Incident: Player leaves area")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)
end
--Registered listeners, do Player_AreaOut function when Player leaves area
--The first parameter is listening event, the second parameter Player_AreaOut function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Player.AreaOut]=],Player_AreaOut)

生物事件相关示例:

--Write a function, just named, when the Creature enters area will perform this function
local function Actor_AreaIn(event)Chat:sendSystemMsg("Incident: Creature enters area")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)
end
--Registered listeners, do Actor_AreaIn function when Creature enters area
--The first parameter is listening event, the second parameter Actor_AreaIn function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Actor.AreaIn]=],Actor_AreaIn)
复制!
---Actor.AreaOut---49
--Write a function, just named, when the Creature leaves area will perform this function
local function Actor_AreaOut(event)Chat:sendSystemMsg("Incident: Creature leaves area")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)
end
--Registered listeners, do Actor_AreaOut function when Creature leaves area
--The first parameter is listening event, the second parameter Actor_AreaOut function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Actor.AreaOut]=],Actor_AreaOut)
复制!
---Actor.Attack---50
--Write a function, just named, when the Creature attacking will perform this function
local function Actor_Attack(event)Chat:sendSystemMsg("Incident: Creature attacking")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners, execute function when Creature attacking Actor_Attack
--The first parameter is listening event, the second parameter Actor_Attack function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Actor.Attack]=],Actor_Attack)
复制!
---Actor.AttackHit---51
--Write a function, just named, when the Creature attack hits will perform this function
local function Actor_AttackHit(event)Chat:sendSystemMsg("Incident: Creature attack hits")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)
end
--Registered listeners, Creature attack hits execution function when Actor_AttackHit
--The first parameter is listening event, the second parameter Actor_AttackHit function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Actor.AttackHit]=],Actor_AttackHit)

阻止事件相关示例:

--Write a function, just named, when Block is created will perform this function
local function Block_Add(event)Chat:sendSystemMsg("Incident: Block is created")Chat:sendSystemMsg("Parameter blockid as:" .. event.blockid)Chat:sendSystemMsg("Parameter x is:" .. event.x)Chat:sendSystemMsg("Parameter y is:" .. event.y)Chat:sendSystemMsg("The parameter z as:" .. event.z)
end
--Registered listeners, do Block_Add function when Block is created
--The first parameter is listening event, function that executes when the second argument Block_Add That incident
ScriptSupportEvent:registerEvent([=[Block.Add]=],Block_Add)
复制!
--Write a function, just named, when Block is destoryed will perform this function
local function Block_DestroyBy(event)Chat:sendSystemMsg("Incident: Block is destroyed")Chat:sendSystemMsg("Parameter eventobjid (opt) as:" .. event.eventobjid (opt))Chat:sendSystemMsg("Parameter blockid as:" .. event.blockid)Chat:sendSystemMsg("Parameter x is:" .. event.x)Chat:sendSystemMsg("Parameter y is:" .. event.y)Chat:sendSystemMsg("The parameter z as:" .. event.z)
end
--Registered listeners, do Block_DestroyBy function when Block is destoryed
--The first parameter is listening event, the second parameter Block_DestroyBy function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Block.DestroyBy]=],Block_DestroyBy)
复制!
--Write a function, just named when the Start mining block will perform this function
local function Block_Dig_Begin(event)Chat:sendSystemMsg("Incident: Start mining block")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter blockid as:" .. event.blockid)Chat:sendSystemMsg("Parameter x is:" .. event.x)Chat:sendSystemMsg("Parameter y is:" .. event.y)Chat:sendSystemMsg("The parameter z as:" .. event.z)
end
--Registered listeners, do Block_Dig_Begin function when Start mining block
--The first parameter is listening event, the second parameter Block_Dig_Begin function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[Block.Dig.Begin]=],Block_Dig_Begin)

项目活动相关示例:

--Write a function, just named, when Drop item enters area will perform this function
local function DropItem_AreaIn(event)Chat:sendSystemMsg("Incident: Drop item enters area")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)Chat:sendSystemMsg("Parameter itemid (opt) as:" .. event.itemid (opt))Chat:sendSystemMsg("Parameter itemnum (opt) as:" .. event.itemnum (opt))
end
--Registered listeners, do DropItem_AreaIn function when Drop item enters area
--The first parameter is listening event, the second parameter DropItem_AreaIn function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[DropItem.AreaIn]=],DropItem_AreaIn)
复制!
--Write a function, just named, when Drop item leaves area will perform this function
local function DropItem_AreaOut(event)Chat:sendSystemMsg("Event: Drop item leaves area")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter areaid as:" .. event.areaid)Chat:sendSystemMsg("Parameter itemid (opt) as:" .. event.itemid (opt))Chat:sendSystemMsg("Parameter itemnum (opt) as:" .. event.itemnum (opt))
end
--Registered listeners, do DropItem_AreaOut function when Drop item leaves area
--The first parameter is listening event, the second parameter DropItem_AreaOut function that is executed when the event occurs
ScriptSupportEvent:registerEvent([=[DropItem.AreaOut]=],DropItem_AreaOut)
复制!
--Write a function, just named when the Item disappear will perform this function
local function Item_Disappear(event)Chat:sendSystemMsg("Incident: Item disappear")Chat:sendSystemMsg("Parameter eventobjid as:" .. event.eventobjid)Chat:sendSystemMsg("Parameter toobjid as:" .. event.toobjid)Chat:sendSystemMsg("Parameter itemid as:" .. event.itemid)Chat:sendSystemMsg("Parameter itemnum as:" .. event.itemnum)
end

--Registered listeners, Item disappear when the function execution Item_Disappear --The first parameter is listening event, the second parameter Item_Disappear function that is executed when the event occurs ScriptSupportEvent:registerEvent([=[Item.Disappear]=],Item_Disappear)

迷你世界api 系统事件

迷你世界api 系统事件相关推荐

  1. 我的世界正版moba服务器,《我的世界》需要氪金?反观《迷你世界》才知道差距!...

    目前最火的沙盒类游戏,当属<迷你世界>和<我的世界>,当然了,大家都知道迷你世界是后起之秀,但是由于不断的运行和打广告,因此在人气方面,迷你世界更加火爆,而作为首创的我的世界却 ...

  2. WINCE之“系统事件”——System/Events

    1. 简介 Event--事件,相信有线程概念的编程人员都知道,它可以用来同步不同进程.不同线程的通信.在Windows CE 5.0系统中,有一种我称之为"系统事件"的Event ...

  3. 迷你世界支持服务器,迷你世界云服务器

    迷你世界云服务器这是一款超级好玩的策略像素游戏丰富多彩的全景地图,同时辅助一定小工具即可自己轻松制造出各种mod,这里提供更多有趣的玩法,游戏中一起探索无尽的世界感兴趣的小伙伴们快来下载试试吧. 迷你 ...

  4. 白鹭引擎助力《迷你世界》研发团队开发3D小游戏版

    <迷你世界>作为国内第一的放置类3D沙盒游戏,依靠三四线城市的游戏市场及垂直媒体的传播途径,研发团队用了短短3年时间就创造出了8000万活跃玩家.5000万玩家原创作品,仅2020年上半年 ...

  5. qtimer不触发原因_迷你世界:触发器玩法多,教你摆表情就能拥有满格血量

    陌瑾出品,争做精品! 迷你世界这款萌系沙盒手游中,拥有一套丰富的开发者工具.可以帮助玩家在游戏内更顺利地进行建筑操作,这类工具像地形编辑器.触发器便是其中的两个. 开发者工具:地形编辑器和触发器 地形 ...

  6. 让运维更高效:关于ECS系统事件

    摘要: 阿里云会针对ECS实例发布系统事件,当您收到阿里云计划维护的通知时,可以利用ECS系统计划事件了解与实例相关的计划维护操作,并根据您的业务特性选择合适的时间安排运维操作进行故障转移,减少对系统 ...

  7. 轻松应对1亿+月活,《迷你世界》背后有啥黑科技

    本文分享自华为云社区<亿级月活沙盒平台<迷你世界>背后的黑科技>,作者:GaussDB 数据库 . 年少时期,我们有过许多梦,想仗剑天涯,想修种藩篱,想成为建筑大师,想改变世界 ...

  8. python编程 迷你世界_迷你编程电脑版|迷你世界迷你编程下载 v1.0官方版 - 绿点软件站...

    迷你世界迷你编程是一款简单易学图形化编程软件,软件采用图形化的编程方式,过程就像组合积木一样简单,不但可以帮助青少年学习基础的编程知识,也提高了数学逻辑思维能力,还可以让孩子们感受到创造三维立体世界的 ...

  9. 《迷你世界》亿级玩家都在用的游戏场景推荐系统长啥样?

    导读:中国TOP1沙盒游戏,如何解决数据存储难题? 提到推荐系统,很多人都在电商购物.资讯或娱乐平台中体验过.比如,你刚在某电商APP买了一部手机,过两天再登录时,首页推荐中必定有耳机.手机壳等手机配 ...

最新文章

  1. 调试coffee script 的一个技巧
  2. Python input()
  3. Python之路【第七篇】:初识Socket
  4. 数据库优化:8 种常见的SQL错误用法
  5. java continue goto_Java中goto和break、continue实现区别
  6. linux c语言 文件拷贝,怎么在linux下用c编程实现文件的复制
  7. iOS NSURLSession VS NSURLConnection
  8. 第一次冲刺-站立会议02
  9. java 二进制右移位_(九)二进制、位运算、位移运算符
  10. 搭建网站显示成功后却打不开主页原因
  11. 笔记本电脑连接无线网总是突然断网
  12. Android内存管理优化建议
  13. Java校招面经_小米java校招面经,面试题整理(一面)
  14. 分享一个做简历的网站
  15. RANSAC算法(仅供学习使用)
  16. style 标签属性 scoped 的作用和原理
  17. 国务院发文,完善身份认证、电子印章等应用,加强数字政府建设
  18. RibbonGatewayopenFeign
  19. 度过有意义的生命(上)
  20. Web前端面试指导(一):写好简历是面试成功的第一步

热门文章

  1. Appium基础篇9-元素定位之by_xpath
  2. java字符串数组转换
  3. IMD/IMT/IME/OMD/OMF等工艺了解
  4. ant design pro表格分页
  5. [授权发表]源码分析:静态分析 C 程序函数调用关系
  6. 战争与征服服务器维护,《战争与征服》12月5日停机维护公告
  7. No.=Number的来历
  8. RS(255,223)纠错算法原理与项目源码
  9. 基于opencv的四轴飞行器寻迹系统(一)——linux下opencv的安装
  10. msfvenom——木马免杀篇