Skip to content

feat: Add per-item usable slot restriction for item-generator items#314

Draft
Copilot wants to merge 3 commits intodevfrom
copilot/enhancement-specify-item-slot
Draft

feat: Add per-item usable slot restriction for item-generator items#314
Copilot wants to merge 3 commits intodevfrom
copilot/enhancement-specify-item-slot

Conversation

Copy link
Copy Markdown

Copilot AI commented Mar 16, 2026

Item-generator items had no way to restrict which equipment slot activates their stats — a chestplate held in the main hand would still apply its attributes. This adds a generator.usable-slots config field that overrides slot detection for attribute modifiers.

Changes

  • ItemTags — new TAG_ITEM_USABLE_SLOTS NBT key constant
  • ItemStatssetUsableSlots / getUsableSlots using the same NBT pattern as existing item data (comma-separated slot names stored under a NamespacedKey)
  • ItemUtils.getItemSlots() — checks for the NBT usable-slots tag first; falls back to existing auto-detection if absent (fully backwards-compatible)
  • GeneratorItem — loads generator.usable-slots from YAML config; writes NBT to the item during build() before attribute generators run
  • EditorGUI — adds USABLE_SLOTS to ItemType enum and a compass button at slot 25
  • UsableSlotsGUI (new) — toggle GUI for HEAD / CHEST / LEGS / FEET / HAND / OFF_HAND using lime/gray dye icons to show enabled/disabled state

Config example

generator:
  usable-slots:
    - CHEST

With this set, attribute modifiers are created only for the CHEST slot, so the item grants stats only when worn in the chest slot. Omitting the key preserves existing behavior.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • jitpack.io
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher help:describe -Dplugin=surefire (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher compile -q (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher test -Dmaven.parent.relativePath= (dns block)
  • maven.elmakers.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher help:describe -Dplugin=surefire (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher compile -q (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher test -Dmaven.parent.relativePath= (dns block)
  • nexus.neetgames.com
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher help:describe -Dplugin=surefire (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher compile -q (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher test -Dmaven.parent.relativePath= (dns block)
  • repo.travja.dev
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher help:describe -Dplugin=surefire (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher compile -q (dns block)
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --enable-native-access=ALL-UNNAMED -classpath /usr/share/apache-maven-3.9.12/boot/plexus-classworlds-2.9.0.jar -Dclassworlds.conf=/usr/share/apache-maven-3.9.12/bin/m2.conf -Dmaven.home=/usr/share/apache-maven-3.9.12 -Dlibrary.jansi.path=/usr/share/apache-maven-3.9.12/lib/jansi-native -Dmaven.multiModuleProjectDirectory=/home/REDACTED/work/divinity/divinity org.codehaus.plexus.classworlds.launcher.Launcher test -Dmaven.parent.relativePath= (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[Enhancement] Specify usable item slot for specific item-generator item in item editor</issue_title>
<issue_description>Currently, ProRPGItems looks for specific slots to apply stats from an item generated using the itemgenerator module (armor slots, hand, offhand..). I think it's a great idea to be able to specify what slot a specific item should be in to actually give its stats. ex. A Iron Chestpiece only gives stats when in the chest armor slot, it would stop interaction such as holding the armor in the hand slot and give its stats. Pretty sure it can have a lot of uses and it would be editable in the item editor ingame gui.
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ement)

Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
Copilot AI changed the title [WIP] [Enhancement] Specify usable item slot for item generator items feat: Add per-item usable slot restriction for item-generator items Mar 16, 2026
Copilot AI requested a review from MaksyKun March 16, 2026 08:35
@MaksyKun
Copy link
Copy Markdown
Contributor

@copilot Have you also considered those items to take slots outside of HEAD / CHEST / LEGS / FEET / HAND / OFF_HAND . So like when people want slot 27 to have an effect, it does so aswell?

Co-authored-by: MaksyKun <77341370+MaksyKun@users.noreply.github.com>
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.

[Enhancement] Specify usable item slot for specific item-generator item in item editor

2 participants