-
Notifications
You must be signed in to change notification settings - Fork 2
Turrets
Turrets are blocks that can fight monsters to defend your base. Buy them from the shop and level them up by spending materials. By default they will also attack players from other teams. Some types of turrets will target your team members and grant buffs instead.
Most turrets require materials as ammo (often bought from the shop as well). When a turret runs out of ammo, all team members will see a message in chat with its location.
Each different type of turret is its own entry in a data pack. These are defined by json files in the turrets folder.
Object Structure:
-
tiers: A list of data for each level.-
cost: A MaterialCollection. how many materials must be spent to upgrade to this level. the cost of the first tier in the list will be used to automatically add a shop entry to buy a placeable turret item of this type. -
minBaseLevel: Determines when a team unlocks the ability to upgrade to this tier. Optional, defaults to 0. -
stats: How powerful this level of turret is-
damage: How many half hearts to do per shot. (use a negative number for healing). -
rangeInBlocks: Radius of a cube. -
shotDelayTicks: How long between each shot (20 ticks = 1 second). -
flameSeconds: How long to light the target on fire. Optional, defaults to 0. -
potionEffects: A list of effect instance objects to give the target. Optional, defaults to an empty list.-
effect: Resource location, ex."minecraft:strength" -
duration: How many ticks the effect should last -
amplifier: What level of effect. Zero based index: 0 = level I, 1 = level II, etc. Optional, defaults to 0.
-
-
color: What accent colour to use for the model. Any of the 16 minecraft wool colours ("red", "lightblue", etc). Optional, defaults to "none". -
rotationDegreesPerTick: How fast to spin to face the target. Optional, defaults to 10. -
ammo: A material collection to take from the team every time it shoots. Optional, defaults to empty so no ammo requirement and it can just shoot infinitely. -
targetSelection: Optional, defaults to "ENEMIES"- "ENEMIES": target monsters (or players on other teams, depending on config)
- "ALLIES": target players on the same team
-
targetPriority: Optional, defaults to "NEAREST"- "NEAREST"
- "RANDOM"
- "LOWEST_HEALTH"
- "HIGHEST_HEALTH"
-
-
Edit the world/serverconfig/basedefense-synced.json5 file.
"turretsWithInvalidTeamTargetAllPlayers": false,"turretsWithInvalidTeamTargetMonsters": false,"turretsWithInvalidTeamHaveInfiniteAmmo": false,"turretsTargetPlayersOnOtherTeams": true,-
"doTurretParticles": true,- Render a beam of particles to the target when turret fires. Currently it's just bubbles which looks kinda silly.
Options starting with turretsWithInvalidTeam apply to turrets that do not have an owner team id set in their nbt. For example, those in generated structures.