Minecraft Skript基础编程 第四部分 推荐适用于有跑酷地图的服务器的代码

介绍适用于有Athlemap的服务器的推荐代码。

对于在Minecraft服务器上设置赛跑类游戏的玩家,这是一个推荐的代码。

禁止放置方塊

Options:
    parkour_map_name: "asure"
    #アスレマップの名前

on place:
    player is in {@parkour_map_name}
    player's gamemode is not creative
    cancel event 

如果玩家在名为asure的世界中,无法放置方块的设定。

使破坏不能

Options:
    parkour_map_name: "asure"
    #アスレマップの名前

on break:
    player is in {@parkour_map_name}
    player's gamemode is not creative
    cancel event 

如果玩家在一个名为 sure 的世界中,阻止他们破坏方块。

使方块无法被破坏。

Options:
    parkour_map_name: "asure"
    #アスレマップの名前

on damage:
    attacker is a player
    attacker is in {@parkour_map_name}
    attacker's gamemode is not creative
    cancel event 

如果攻击的玩家在一个名为asure的世界中,将无法攻击其他玩家。

禁止破坏方块

Options:
    parkour_map_name: "asure"
    #アスレマップの名前

on damage:
    victim is in {@parkour_map_name}
    damage cause is fall
    cancel event

如果玩家在名为 “asure” 的世界中的话,会取消下落伤害。

检查点

Options:
    parkour_map_name: "asure"
    #アスレマップの名前

    block_of_check_point: beacon
    #チェックポイント用のブロック
    under_block_of_check_point: glowstone
    #チェックポイント用のブロックの下のブロック
    sound_of_set_check_point: "entity_player_levelup"
    #チェックポイントを設定したときの音
    sound_of_teleport_check_point: "entity_endermen_teleport"
    #チェックポイント用のブロックの下のブロック

on rightclick:
    player is in {@parkour_map_name}
    if event-block is not {@block_of_check_point}:
        event-item is red dye named "&6Teleport Spawn point"
        cancel event
        if {%UUID of player%.spawnpoint} is set:
            teleport player to {%UUID of player%.spawnpoint}
            send "&8[&c&lMLS&8] &5チェックポイントにテレポートしました" to player
            play {@sound_of_teleport_check_point} to player at volume 1
            stop
        else:
            teleport player to spawnpoint of player's world
            send "&8[&c&lMLS&8] &5スポーンポイントにテレポートしました" to player
            play {@sound_of_teleport_check_point} to player at volume 1
            stop
    if event-block is {@block_of_check_point}:
        block under the event-block is {@under_block_of_check_point}
        cancel event
        if block under the player is not air:
            set {%UUID of player%.spawnpoint} to location of player
            send "&8[&c&lMLS&8] &5チェックポイントを設定しました" to player
            play {@sound_of_set_check_point} to player at volume 1
            stop
        else:
            stop

当手持有名为“&6Teleport Spawn point”(传送生成点)的红色染料时,右击会将你传送到检查点。
但如果没有设置检查点,将会将你传送到玩家所在地图的重生点。

如果向着设置为检查点的方块(此处为信标)右击,如果下方的方块是设置的方块(此处为萤石),则将当前坐标设为检查点。

然而,玩家脚下必须有方块作为条件。

当进行传送或设置检查点时,我们会播放声音,但这需要skrayfall。

所有代码

如果您下载并直接安装这段代码,我认为它会正常运行。
* skrayfall是必需的

下载请点击此处

分发的东西可以通过选项设置消息等内容。

暂时把代码贴在这里。

# ================================
#    アスレサーバー用Skript
#    Created by Monster2408
# ================================

Options:
    parkour_map_name: "asure"
    #アスレマップの名前

    place_cancel_message: "&8[&c&lMLS&8] &cあなたはブロックを設置することはできません"
    #ブロックの設置をキャンセルしたときに流れるメッセージです

    break_cancel_message: "&8[&c&lMLS&8] &cあなたはブロックを破壊することはできません"
    #ブロックの設置をキャンセルしたときに流れるメッセージです

    hit_cancel_message: "&8[&c&lMLS&8] &cあなたはそのプレイヤーを殴ることはできません"
    #ブロックの設置をキャンセルしたときに流れるメッセージです

    block_of_check_point: beacon
    #チェックポイント用のブロック
    under_block_of_check_point: glowstone
    #チェックポイント用のブロックの下のブロック
    sound_of_set_check_point: "entity_player_levelup"
    #チェックポイントを設定したときの音
    message_of_set_check_point: "&8[&c&lMLS&8] &5チェックポイントを設定しました"
    #チェックポイントを設定したときの音
    sound_of_teleport_check_point: "entity_endermen_teleport"
    #テレポートしたときの音
    teleport_message_of_check_point: "&8[&c&lMLS&8] &5チェックポイントにテレポートしました"
    #チェックポイントにテレポートしたときのメッセージ
    teleport_message_of_spawn_point: "&8[&c&lMLS&8] &5スポーンポイントにテレポートしました"
    #スポーンポイントにテレポートしたときのメッセージ

    could_not_teleport: "block_anvil_use"
    #テレポートできなかったときの音
    could_not_teleport_message: "&8[&c&lMLS&8] &cアスレマップでなければテレポートできません"
    #テレポートできなかったときのメッセージ

on place:
    player is in {@parkour_map_name}
    player's gamemode is not creative
    send {@place_cancel_message} to player
    cancel event 

on break:
    player is in {@parkour_map_name}
    player's gamemode is not creative
    send {@break_cancel_message} to player
    cancel event 

on damage:
    attacker is a player
    victim is a player
    attacker is in {@parkour_map_name}
    attacker's gamemode is not creative
    send {@hit_cancel_message} to player
    cancel event 

on damage:
    victim is in {@parkour_map_name}
    damage cause is fall
    cancel event

on rightclick:
    player is in {@parkour_map_name}
    if event-block is not {@block_of_check_point}:
        event-item is red dye named "&6Teleport Spawn point"
        cancel event
        if {%UUID of player%.spawnpoint} is set:
            teleport player to {%UUID of player%.spawnpoint}
            send {@teleport_message_of_check_point} to player
            play {@sound_of_teleport_check_point} to player at volume 1
            stop
        else:
            teleport player to spawnpoint of player's world
            send {@teleport_message_of_spawn_point} to player
            play {@sound_of_teleport_check_point} to player at volume 1
            stop
    if event-block is {@block_of_check_point}:
        block under the event-block is {@under_block_of_check_point}
        cancel event
        if block under the player is not air:
            set {%UUID of player%.spawnpoint} to location of player
            send {@message_of_set_check_point} to player
            play {@sound_of_set_check_point} to player at volume 1
            stop
        else:
            stop

command /checktp:
    trigger:
        if player is in {@parkour_map_name}:
            if {%UUID of player%.spawnpoint} is set:
                teleport player to {%UUID of player%.spawnpoint}
                send {@teleport_message_of_check_point} to player
                play {@sound_of_teleport_check_point} to player at volume 1
                stop
            else:
                teleport player to spawnpoint of player's world
                send {@teleport_message_of_spawn_point} to player
                play {@sound_of_teleport_check_point} to player at volume 1
                stop
        else:
            send {@could_not_teleport_message} to player
            play {@could_not_teleport} to player at volume 1
            stop

最后

脚本被认为是编程吗,这个问题很难回答,但是有些人在编程时会偶尔说“不要看答案或听别人说,要自己思考和研究”。

在我看来,通过查看答案(源代码)来学习也是一种方法。

我认为学会这个可能需要一点时间,但是这取决于个人的适应能力,所以很难说……

请期待下次节目。

下一个是这个

(xià shì

以前是这边。