Shield System
No reviews yet
a minecraft mod that provide a simple shield system
Neoforge is a fork of the Minecraft Forge available for versions 1.20.1+ of Minecraft. Many Forge mods are compatible with Neoforge and vice versa.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
Resources
External Links
About
Description
This is an independent shield system from SimpleRPG Core.
It provides a shield system similar to that of League of Legends and it has complete kubejs support.

Currently adapted to Overflow Bars
for kubejs:
StartupEvents.registry("shield_system:shield_type", event => {
//Create a simple unit shield that exists permanently
event.create("kubejs_test_unit")
.createSimpleUnitShield()
//Create a simple shield group, where the unit shields of the shield group permanently exist
event.create("kubejs_test_group")
.createSimpleGroupShield()
//Create a shield that lasts for 5 seconds and belongs to the shield group
event.create("kubejs_test_time")
.createTimeLimitedShield(20 * 5)
//Create a shield that continuously decays within 5 seconds and belongs to the shield group
event.create("kubejs_test_decay")
.createDecayShield(20 * 5)
//Next is the advanced section
event.create("kubejs_custom_1")
//Add shield provider
.shieldFactory(
//Use the unit shield constructor to provide kjs objects for the builder, making it easier to manage
() => UnitShieldBuilder.of((initAmount) => new TestShield(initAmount))
//tick
.tick((kubeUnitShield, living) => {
kubeUnitShield.getKubeObject().tick(kubeUnitShield, living)
})
//save
.save((kubeUnitShield, living) => {
kubeUnitShield.getKubeObject().save(kubeUnitShield, living)
})
//load
.load((kubeUnitShield, living) => {
kubeUnitShield.getKubeObject().load(kubeUnitShield, living)
})
//Since it is a unit shield, a unit shield constructor should not be provided, but rather a unit shield should be provided directly. Therefore,. create (0)
.build().create(0)
)
event.create("kubejs_cunstom_2")
.shieldFactory(
//Use shield group
() => new GroupShield(
//Use the unit shield constructor to provide kjs objects for the builder, making it easier to manage
UnitShieldBuilder.of((initAmount) => new TestShield(initAmount))
.tick((kubeUnitShield, living) => {
kubeUnitShield.getKubeObject().tick(kubeUnitShield, living)
})
.save((kubeUnitShield, living) => {
kubeUnitShield.getKubeObject().save(kubeUnitShield, living)
})
.load((kubeUnitShield, living) => {
kubeUnitShield.getKubeObject().load(kubeUnitShield, living)
})
//Since it is a shield group, there is no initial shield, so a unit shield constructor is provided here without the need for. create (0)
.build()
)
)
})
function TestShield(initAmount) {
this.initAmount = initAmount
}
/**
* @param {$KubeUnitShield_<TestShield} kubeUnitShield
* @param {$LivingEntity_} living
*/
TestShield.prototype.tick = function (kubeUnitShield, living) {
kubeUnitShield.reduceShieldAmount(this.initAmount / 100)
}
/**
* @param {$KubeUnitShield_<TestShield} kubeUnitShield
* @param {$LivingEntity_} living
*/
TestShield.prototype.save = function (kubeUnitShield, living) {
}
/**
* @param {$KubeUnitShield_<TestShield} kubeUnitShield
* @param {$LivingEntity_} living
*/
TestShield.prototype.load = function (kubeUnitShield, living) {
}
/**
* @param {$LivingEntity_} living
*/
TestShield.prototype.sendMessage = function (living) {
living.sendSystemMessage(this.initAmount)
}
ShieldSystemEvents.RegisterShieldPriority(event => {
//Register shield priority, shields without registered priority will not take effect
event.addShieldType("kubejs:kubejs_test_group")
event.addShieldType("kubejs:kubejs_test_time")
event.addShieldType("kubejs:kubejs_test_decay")
})
for API use
EntityEvents.afterHurt(event => {
//There are two situations to add shield values to a shield:
//If the target shield is a shield group, a unit shield will be created based on the provided shield value, and then the unit shield will be added to the shield group
//If the target shield is a unit shield, the shield value will be directly increased on the basis of the original shield value
ShieldAPI.addShieldAmount(event.entity, "kubejs:kubejs_test_decay", 80)
//reduce shield
ShieldAPI.reduceShieldAmount(event.entity, "kubejs:kubejs_test_decay", 40)
//get shield instance
var shieldInstance = ShieldAPI.getShieldInstance(event.entity, "kubejs:kubejs_test_decay")
})
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers
Statistics
Resources