Skip to content

Commit

Permalink
add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
friendlyhj committed Sep 10, 2023
1 parent fa5b3a4 commit 35332be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion actual-combat/events/ban-creative-mode.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 禁止开创造

**该脚本仅作为取消事件的例子,作者并不赞成禁止指令的操作!**

```csharp
import crafttweaker.events.IEventManager;
import crafttweaker.event.CommandEvent;
Expand All @@ -10,7 +12,7 @@ events.onCommand(function(event as CommandEvent){
// event.command.name 获取命令名
// event.parameters 为包含命令参数的字符串数组
// in操作符检查一个字符串数组是否有某个元素
event.cancel(); //取消事件
event.cancel(); //取消事件,即阻止指令结果的产生
}
});
```

0 comments on commit 35332be

Please sign in to comment.