Skip to content

Conversation

@JasperLorelai
Copy link

@JasperLorelai JasperLorelai commented Sep 7, 2025

Changelog:

Additions:

  • Added disable-slots to armorstand spell effect. Boolean, defaulting to true.
  • New Entity Data options:
    • Entity:
      • no-physics, persistent, and invulnerable - Boolean
      • fire-ticks and freeze-ticks - Integer
      • visual-fire - true, false, or not_set.
      • scoreboard-tags - Aside from a list of strings of tags to add, you can now specify a list of configuration sections with operation (default add, remove, and clear), and tag string option to add or remove.
      • passengers - List of Entity Data
    • Living Entity:
      • can-pickup-items - Boolean
      • max-health - Double
    • Mob:
      • aware - Boolean
      • mob-goals:
    • Tameable:
      • tamed-owner - Boolean - sets the entity as tamed and the recipient as its owner (caster of the spell or target of a Buff).
    • armor_stand:
    • chicken:
    • copper_golem:
      • copper_golem section:
        • weathering-state - WeatheringCopperState
        • oxidizing - May be unset, in which case oxidation happens naturally; waxed, in which case it is disabled; or a (Long type) number of ticks until the next weathering state.
    • command_minecart:
      • command - String
    • cow:
    • falling_block:
      • cancel-drop and hurt-entities - Boolean
      • damage-per-block - Float
      • max-damage - Integer
    • Frictional:
      • friction-state - true, false, or not_set
    • goat:
      • left-horn, right-horn, and screaming - Boolean
    • hoglin:
      • immune-to-zombification and able-to-be-hunted - Boolean
    • mannequin:
      • mannequin section:
        • immovable - Boolean
        • In a skin-parts section, boolean options for cape, jacket, left-sleeve, right-sleeve, left-pants, right-pants, and hats.
        • description - Rich Text
        • main-hand - MainHand
        • profile section:
    • item:
    • Minecart:
      • max-speed - Double
      • slow-when-empty - Boolean
      • display-block-offset - Integer
      • display-block - Block Data
    • piglin:
      • able-to-hunt - Boolean
      • dancing - Integer ticks
    • Piglin Abstract:
      • immune-to-zombification - Boolean
    • Raider:
      • patrol-leader, can-join-raid, and celebrating - Boolean
    • salmon:
    • vindicator:
      • johnny - Boolean
    • zombie_villager:
  • Added .targeted.ApplyEntityDataSpell with entity Entity Data option. This spell applies the configured Entity Data to the targeted entity.
  • Added .targeted.EntityRemoveSpell, which removes non-player entity targets from the world without the death animation.

@JasperLorelai JasperLorelai mentioned this pull request Sep 7, 2025
@JasperLorelai JasperLorelai force-pushed the entity-data-feat branch 3 times, most recently from bc83555 to 5db4599 Compare September 8, 2025 19:04
@JasperLorelai JasperLorelai marked this pull request as ready for review October 9, 2025 17:36
@JasperLorelai

This comment was marked as outdated.

@JasperLorelai JasperLorelai marked this pull request as draft October 23, 2025 03:24
- "disable-slots" (bool) - to EntityData and "armorstand" spell effect where it's "true" by default
- "disable-slots" (EquipmentSlot enum list)
- "equipment-locks" (list of sections with EquipmentSlot "slot" and ArmorStand.LockType "lock")
@JasperLorelai

This comment was marked as outdated.

@JasperLorelai JasperLorelai marked this pull request as ready for review November 13, 2025 23:22
@JasperLorelai
Copy link
Author

JasperLorelai commented Nov 13, 2025

I'm also considering whether we should add a textures option to mannequin to configure the texture properties of a mannequin (texture & signature).

@JasperLorelai JasperLorelai force-pushed the entity-data-feat branch 2 times, most recently from 50ad41c to 8a6768c Compare November 16, 2025 16:46
addOptSkinParts(transformers, config, "mannequin.skin-parts.right-pants", SkinParts.Mutable::setRightPantsEnabled);
addOptSkinParts(transformers, config, "mannequin.skin-parts.hats", SkinParts.Mutable::setHatsEnabled);

addComponent(transformers, config, "mannequin.description", Mannequin.class, Mannequin::setDescription, null, forceOptional);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have a default value for this option?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a custom name is set on a Mannequin, it is shifted up so that a description component shows up below it, with the default one being "NPC" (<lang:entity.minecraft.mannequin.label>). To hide the description, you can set it to an empty string, but the nameplate remains shifted. If you can set the description to null, the nameplate is at its usual elevation.

I figured our users would favour the nameplate not shifting over having the default description, which can still be accessed with the MiniMessage translation component.

Comment on lines +685 to +758
// Mob Goals
ConfigurationSection mobGoals = config.getConfigurationSection("mob-goals");
if (mobGoals != null) {
if (mobGoals.getBoolean("remove-all"))
transformers.put(Mob.class, (Mob mob, SpellData data) -> Bukkit.getMobGoals().removeAllGoals(mob));

for (String string : mobGoals.getStringList("remove-types")) {
ConfigData<GoalType> typeData = ConfigDataUtil.getEnum(string, GoalType.class, null);

transformers.put(Mob.class, (Mob mob, SpellData data) -> {
GoalType type = typeData.get(data);
if (type == null) return;

Bukkit.getMobGoals().removeAllGoals(mob, type);
});
}

for (String string : mobGoals.getStringList("remove")) {
ConfigData<NamespacedKey> keyData = ConfigDataUtil.getNamespacedKey(string, null);

transformers.put(Mob.class, (Mob mob, SpellData data) -> {
NamespacedKey key = keyData.get(data);
if (key == null) return;

Bukkit.getMobGoals().removeGoal(mob, GoalKey.of(Mob.class, key));
});
}

for (String string : mobGoals.getStringList("remove-vanilla")) {
ConfigData<String> stringData = ConfigDataUtil.getString(string);

transformers.put(Mob.class, (Mob mob, SpellData data) -> {
String value = stringData.get(data);
if (value == null) return;

GoalKey<?> key = MagicSpells.getCustomGoalsManager().getVanillaGoal(value);
if (key == null) return;

// We have to loop through because casting to parameter types is tricky.
// It loops through on each MobGoals#removeGoal call anyway.
for (Goal<@NotNull Mob> goal : Bukkit.getMobGoals().getAllGoals(mob)) {
if (!goal.getKey().equals(key)) continue;
Bukkit.getMobGoals().removeGoal(mob, goal);
}
});
}

for (Object object : mobGoals.getList("add", new ArrayList<>())) {
if (!(object instanceof Map<?, ?> map)) continue;
ConfigurationSection section = ConfigReaderUtil.mapToSection(map);

ConfigData<Integer> priorityData = ConfigDataUtil.getInteger(section, "priority", 0);
ConfigData<String> goalNameData = ConfigDataUtil.getString(section, "goal", "");

ConfigurationSection goalSection = section.getConfigurationSection("data");
if (goalSection == null) continue;

transformers.put(Mob.class, (Mob mob, SpellData data) -> {
int priority = priorityData.get(data);
String goalName = goalNameData.get(data);

CustomGoal goal = MagicSpells.getCustomGoalsManager().getGoal(goalName, mob, data);
if (goal == null) return;

boolean success = goal.initialize(goalSection);
if (success) Bukkit.getMobGoals().addGoal(mob, priority, goal);
});
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be structured more like what you did for scoreboard-tags.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually regret the new format for scoreboard-tags as a list of ordered actions, since clear only ever makes sense if done first, and add or remove order doesn't matter, so the format should've probably been a bool clear action that holds priority, followed by a list of add and remove strings. mob-goals is a bit more complex to be switched to a string list in a similar structure, and this format was copied from MobGoalEditSpell, so I think it's more fitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants