1 320
收录服务器
1 837
注册
43 099
玩家
DefensiveTurrets | Defend Yourself using Turrets! [1.8-1.16]
用户可以放置和升级炮塔以防御敌人的机械师
作 者 Ajneb97
发布时间 2019年5月8日
支持核心 Spigot
原生版本
支持版本 1.8,1.9,1.10,1.11,1.12,1.13,1.14,1.15,1.16
点此下载

🛡️ DefensiveTurrets 是一款 Minecraft 插件,允许玩家放置不同类型的炮塔来保护他们的家园或领地。目前有四种类型的炮塔:速射型、激光型、攻城型和治疗型。这些炮塔会持续攻击(或治疗)怪物、玩家和动物,使它们远离你的领地。你可以自定义炮塔的各种属性,如伤害、范围、冷却时间、速度和声音,并且可以为每个炮塔添加任意数量的升级。

🛡️ DefensiveTurrets

🌟 功能特性

  • ✅ 4 种不同类型的炮塔:速射型、激光型、攻城型、治疗型
  • ✅ 可配置的炮塔属性:
    • 最小和最大伤害
    • 方块 ID、名称和描述
    • 冷却时间
    • 范围
    • 任意数量的升级
    • 声音
    • 特殊选项
    • 炮塔外观设计(2 个方块和头颅)
  • ✅ 伤害和信息全息显示(使用 HolographicDisplays 插件)
  • ✅ 炮塔之间的最小距离限制
  • ✅ 炮塔可以攻击怪物、玩家和动物(可在每个炮塔中配置)
  • ✅ 每个炮塔的独立权限选项
  • ✅ 对以下插件的盟友支持:Factions/SavageFactions/SaberFactions/FactionsUUID/Towny/Clans/Lands/Better Teams
  • ✅ 每个炮塔的玩家盟友列表
  • ✅ 炮塔弹药系统
  • ✅ 无限弹药选项
  • ✅ 炮塔放置数量限制
  • ✅ 兼容 Minecraft 1.8+
  • ✅ messages.yml 文件用于翻译

⚙️ 安装指南

  1. 下载 DefensiveTurrets 插件和 Vault 插件:Vault
  2. 如果需要显示全息图,请安装 HolographicDisplays 插件:HolographicDisplays
  3. 使用 /dt give <炮塔类型> <玩家名> 命令给予玩家炮塔。你可以在控制台中使用此命令。请使用有效的炮塔类型名称(Burst, Laser, Siege 或 Healing)。
    1. 将炮塔方块放置在地面上并右键点击它。将打开一个物品栏,用于查看当前的炮塔属性并升级其等级(以获得更好的属性)。
    2. 你可以打开炮塔选项菜单,在这里可以更改一些炮塔属性。你可以禁用目标,例如玩家、怪物或动物。此外,你还可以启用或禁用炮塔。
    3. 玩家可以将其他玩家添加到白名单中,炮塔不会攻击白名单中的玩家。你可以在同一个物品栏中随时移除他们。
    4. 如果在配置中启用了弹药选项,你需要为炮塔添加弹药才能开始射击。请记住在添加弹药时禁用炮塔。
    5. 如果你是 OP 或者拥有 defensiveturrets.admin/defensiveturrets.infiniteammo 权限,物品栏中将出现一个额外的物品,用于定义炮塔是否应该具有无限弹药。
  4. 根据你的需要在相应的配置文件中更改炮塔属性(在 turrets 文件夹中可以找到炮塔文件),具体教程如下:

炮塔配置教程

每个炮塔文件都具有相同的格式,但最重要的是 "Turret" 部分,你可以在其中重命名炮塔、更改其声音,并最终为其创建升级。由于每个炮塔都不同,因此它们具有不同的属性。

如果要将炮塔的方块定义为头颅,请使用:

id: "PLAYER_HEAD" (or "SKULL_ITEM:3" for 1.8-1.12)
head: "id;texture"

你可以在这里找到头颅:Minecraft Heads

对于 sound 属性,请注意,不同 Minecraft 版本中的声音名称不同:

速射型炮塔 (Burst.yml)

描述:速度快的炮塔,没有额外的能力。

配置示例

#Format: - "Price;min_damage;max_damage;cooldown(in seconds);range(in blocks)"
upgrades:
    - "0;1-1.5;0.75;10"
    - "800;1.75-2.25;0.5;13"
    - "2500;2.75-4;0.25;16"

激光型炮塔 (Laser.yml)

描述:速度中等的炮塔,每次击中都会推动敌人。

配置示例

#Format: - "Price;min_damage;max_damage;cooldown(in seconds);range(in blocks);power"
upgrades:
    - "0;5-7;2;15;0.5"
    - "800;9-13;1.75;17;1"
    - "2500;16-22;1.5;20;1.5"

攻城型炮塔 (Siege.yml)

描述:速度慢的炮塔,每次击中都会伤害多个敌人。

配置示例

#Format: - "Price;min_damage;max_damage;cooldown(in seconds);range(in blocks);radius"
upgrades:
    - "0;4-9;3;8;1.5"
    - "800;8-15;2.5;11;2.5"
    - "2500;13-20;2;14;3.5"

治疗型炮塔 (Healing.yml)

描述:速度慢的炮塔,可以治疗多个盟友。

配置示例

#Format: - "Price;min_damage;max_damage;cooldown(in seconds);range(in blocks);max_targets"
upgrades:
    - "0;2-4;6;5;2"
    - "800;3-5;5.5;6;3"
    - "2500;4-6;5;7;4"

Config.yml 配置教程

Config:
    enable_turrets_only_when_owner_is_online: false
    min_distance_between_turrets: 1
    damage_holograms: true
    information_holograms: true
    new_version_reminder: true
    per_turret_permissions: false
    ally_protection: true
    walls_better_check: false
    turrets_require_ammunition: true
    shoot_through_liquids: false
    ignore_damage_to_invisible_players: true
    turrets_global_check_time: 5
    turret_limit_permissions:
        enabled: true
        default_limit: 1
    protect_turrets_from_explosions: true
    drop_turret_on_destroy: true
    receive_turret_on_destroy: true
    blacklisted_worlds:
    - minigames
    - lobby
    default_turret_options:
        attack_monsters: true
        attack_animals: false
        attack_players: false
    delete_turret_item:
        id: "REDSTONE_BLOCK"
        name: "&cDestroy Turret"
        lore:
        - "&7This action cannot be undone!"
    turret_options_item:
        id: "CRAFTING_TABLE"
        name: "&aTurret Options"
    inventory_back_item:
        id: "ARROW"
        name: "&7Back"
#If this option is enabled, the turret will be deactivated when the player leaves the server.
enable_turrets_only_when_owner_is_online: true

#This number defines the minimum separation in blocks between turrets. 
min_distance_between_turrets: 1

#These options allows you to enable holograms when turrets hits enemies and when players look at turrets.
damage_holograms: true
information_holograms: true

#If this option is enabled, you have to add the corresponding permission of turrets to players. (defensiveturrets.use.)
per_turret_permission: true

#If this option is enabled, you can limit the amount of turret that players can place. (defensiveturrets.limit.X). If a group doesn't have the permission, the default_limit will be used.
turret_limit_permissions:
        enabled: true
        default_limit: 1

#If this option is enabled, explosions will not affect turrets. If is set to false, turrets will be destroyed and removed from the config when exploding.
protect_turrets_from_explosions: true

#If this option is enabled, allies like factions,towny will not be attacked by your turrets.
ally_protection: true

#If this option is enabled, more blocks will be checked to determine if there are obstacles between an entity and the turret. The performance could decrease a little bit.
walls_better_check: false

#If this option is enabled, turrets will need ammo in order to shoot. You can give ammo to players using the command below.
turrets_require_ammunition: true

#If this option is enabled, turrets will be able to shoot through water and lava.
shoot_through_liquids: false

#This option will fix and remove turrets which were destroyed by external sources, like WorldEdit. Here you can set the amount of time (in seconds) of these periodical checks.
turrets_global_check_time: 5

#If enabled, whitelisted players will be checked ignoring upper and lower cases.
whitelist_ignore_case: true

#If enabled, siege turrets will destroy ALL blocks with the explosion.
siege_turret_destroy_blocks: false

#Players will not be able to place Turrets in these worlds.
blacklisted_worlds:
- minigames
- lobby

#If this option is enabled, players will receive the Turret block when destroying it. Doesn't keep the upgrades.
receive_turret_on_destroy: true

#When this is enabled, turrets will drop a turret block when being destroyed (like from explosions, or worldedit)
drop_turret_on_destroy: true

#Here you can define the default values for some turret options.
default_turret_options:
        attack_monsters: true
        attack_animals: false
        attack_players: false

messages.yml

Messages:
    prefix: "&8[&aDefensive&9Turrets&8]"
    noPermissions: "&cYou don't have permissions to execute that command."
    configReloaded: "&aConfig Reloaded!"
    giveCommandError: "&cYou need to use &7/dt give  "
    playerNotOnline: "&cThat player is not online."
    turretDoesNotExist: "&cThat turret doesn't exists."
    giveCommandSuccessPlayer: "%name% &aadded to your inventory!"
    giveCommandSuccessSender: "&aYou gave %name% &ato &e%player%&a!"
    turretCreated : "&aTurret created!"
    cantDestroyTurret: "&cTo destroy a Turret you need to open its inventory using Right Click."
    turretInventory: "&9Turret Inventory"
    notYourTurret: "&cThis is not your turret!"
    openingTurretInventory: "&aOpening Turret Inventory."
    turretRemoved: "&aTurret removed!"
    turretUpgraded: "&aTurret upgraded to Level: &e%level%&a!"
    noEnoughMoney: "&cYou don't have enough money to upgrade this Turret."
    minDistanceError: "&cThere is another turret nearby!"
    damageHologram: "&c-%damage% &8[&a%player%&8]"
    healHologram: "&a+%heal%&4❤ &8[&a%player%&8]"
    informationHologram:
    - "&8[&6%turret_name%&8]"
    - "&7Owner: &a%owner%"
    - "&7Level: &a%level%"
    - "%damage_type%: &a%min%&8-&a%max%"
    - "%error%"
    informationHologramNoAmmoError: "&cOut of ammo!"
    informationHologramNotEnabledError: "&cTurret disabled!"
    informationHologramTypeDamage: "&7Damage"
    informationHologramTypeHeal: "&7Heal"
    soundError: "&7&l%name% &cis not a valid Sound. Check your config!"
    placeTurretNoPermissions: "&cYou don't have permissions to use that Turret."
    turretOptionAttackMonsters: "&6Attack Monsters"
    turretOptionAttackPlayers: "&6Attack Players"
    turretOptionAttackAnimals: "&6Attack Animals"
    turretOptionEnabled: "&7Status: &aENABLED"
    turretOptionDisabled: "&7Status: &cDISABLED"
    turretDestroyed: "&cYour &a%name% &cin &8[&7%x_coord%,%y_coord%,%z_coord%&8] &cwas destroyed!"
    turretLimitError: "&cYou can't place another turret, your limit is: &7%limit%"
    turretOptionPermissionsError: "&cYou don't have permissions to modify this option."
    turretOptionPlayers: "&6Whitelisted Players"
    turretOptionPlayersList: "&8- &a%name%"
    turretOptionPlayersListNone: "&8None"
    turretOptionPlayersPlayerLore:
    - "&8[&cRight Click to remove player&8]"
    turretOptionPlayersAddPlayer: "&aAdd Player"
    turretOptionPlayerRemoved: "&cPlayer &e%name% &cremoved from your Turret."
    turretOptionPlayersAddPlayerInfo: "&aWrite the name of the player you want to add to your turret:"
    turretOptionAddPlayerNotValid: "&cThat's not a valid player name."
    turretOptionAddPlayerOwnName: "&cIt's not necessary to add you to your own turret."
    turretOptionAddPlayerAlreadyAdded: "&cThat player is already added on this turret."
    turretOptionAddPlayerSuccess: "&aPlayer &e%name% &aadded to your Turret!"
    giveammoCommandError: "&cYou need to use &7/dt giveammo   "
    giveammoCommandSuccessPlayer: "%name% &aadded to your inventory!"
    giveammoCommandSuccessSender: "&aYou gave %name% &ato &e%player%&a!"
    amountError: "&cYou need to write a valid amount."
    turretOptionAmmunitionStorage: "&6Ammunition Storage"
    turretOptionAmmunitionCurrentAmmo: "&7Current Ammo: &9%ammo%"
    turretOptionAmmunitionError: "&cThat's not the correct ammo for this turret."
    turretEnabled: "&6Turret: &aENABLED"
    turretDisabled: "&6Turret: &cDISABLED"
    turretStatusMessage: "&8[&7Click to change Status&8]"
    turretOptionAmmunitionDisabledError: "&cThe turret must be disabled to add ammo."
    placeTurretWorldError: "&cYou can't place a turret in this world."
    removeTurretsCommandError: "&cYou need to use &7/dt removeturrets  "
    removeTurretsRemoved: "&e%turrets% &aTurrets were removed!"
    removeTurretsNoRemoved: "&cNo Turrets were removed!"
    turretInfiniteAmmoEnabled: "&6Infinite Ammo: &aENABLED"
    turretInfiniteAmmoDisabled: "&6Infinite Ammo: &cDISABLED"
    turretInfiniteAmmoStatusMessage: "&8[&7Click to change Status&8]"
    playerDeath: "&f%player% &fwas killed by &a%killer% &f%turret%"

如果在配置中更改了任何内容,请记住使用 /dt reload 命令保存更改。 如果没有任何反应,最好停止服务器并重新启动。

🖥️ API

该插件目前有一个小型 API。

要使其工作,你需要将我的插件添加到你的插件外部 jar 依赖项,并在你的 plugin.yml 文件中设置 softdepends: DefensiveTurrets

//Event called when player places a Turret Block
@EventHandler
public void placeTurret(TurretPlaceEvent event){
   Player player = event.getPlayer();
   String turretName = event.getTurretName();
   Location turretLocation = event.getLocation();
}
//Event called when a Turret kills an entity
@EventHandler
public void turretKill(TurretKillEvent event){
   String owner = event.getOwnerName();
   String turretName = event.getTurretName();
   Entity killedEntity = event.getEntity();
}

🌐 翻译

⌨️ 命令

  • /dt give <炮塔类型> <玩家名>:给予指定玩家选择的炮塔。
  • /dt giveammo <炮塔类型> <玩家名> <数量>:给予玩家弹药。
  • /dt removeturrets <world/player/all> <值>:移除已放置的炮塔。
    • 从世界移除炮塔:/dt removeturrets world <世界名>
    • 从玩家移除炮塔:/dt removeturrets player <玩家名>
    • 移除所有炮塔:/dt removeturrets all
  • /dt reload:重载配置。
  • /dt help:显示此消息。
  • (别名: /defensiveturrets)

🔑 权限

  • defensiveturrets.admin
  • defensiveturrets.admin.open (允许打开其他人的炮塔)
  • defensiveturrets.use.<炮塔类型> (如果在配置中启用了 per_turret_permissions)
  • defensiveturrets.limit.X (如果在配置中启用了 turret_limit_permissions。例如,具有权限 defensiveturrets.limit.5 的组最多可以放置 5 个炮塔。如果一个组没有限制权限,将使用默认限制)
  • defensiveturrets.infiniteammo (允许玩家激活炮塔上的无限弹药物品)
  • defensiveturrets.options.attackmonsters
  • defensiveturrets.options.attackplayers
  • defensiveturrets.options.attackanimals