2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Minecraft Skript - 3. コマンドを作ろう

Last updated at Posted at 2024-03-09

おい!サボってんじゃねぇ!

前回の投稿日時:
image.png
ずーっと更新してませんでした。ごめんなさい。

さて、今日はコマンドを作りましょう。
非常に多くのパターンがありますが、主に使うものだけまとめました。

基本的な形

command /hello:
    trigger:
        send "Hello Skript!" to player

超シンプルですね。
command /<コマンド名> <arg>の形となっています。
<arg>にはtextnumberplayerなどが入ります。

特定の権限を持つユーザーのみに使用させたい場合

command /forcetp [<player>]:
    permission: meow.admin #ここで指定
    permission message: 権限がないのに実行しようとするなんて...あんた馬鹿ぁ? #権限不足時のメッセージ
    trigger:
        teleport arg-1 to {lobby}
        send "&aSuccess!"

これも簡単。meow.adminという権限を持つユーザーのみ実行可能になりました。
permission messageはお好みでどうぞ。

OP権限を持つユーザーにのみ実行させたい場合は
opまたはadminとすることで可能です。

実行可能な対象を指定したい場合

command /togglesecurity:
    executable by: console
    trigger:
        #コード

シンプル。素晴らしい!

executable byにはconsole,またはplayersを指定できます。

コマンドのエイリアスを作成する場合

command /longlongcommand:
    aliases: /shortcmd, /scmd
    trigger:
        #コード

人によってはよく使いそうですね。

複数個のエイリアスが必要な場合は,で区切るようにしてください。

おわり!

「こういうの紹介してよ」みたいなのがあれば是非コメントしてください。
またどこかでお会いしましょう :wave:

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?