Skript's PDC syntax is likely to break compatibility with other plugins that using PDC

Aperta
#8,593 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@sovdeeth ci sta già lavorando.

Dal 5/5/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug priority: medium
Skript/Server Version
[19:03:17 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[19:03:17 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[19:03:17 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[19:03:17 INFO]: [Skript] Server Version: 1.21.11-130-c5a2736 (MC: 1.21.11)
[19:03:17 INFO]: [Skript] Skript Version: 2.15.0 (skriptlang-github)
[19:03:17 INFO]: [Skript] Installed Skript Addons:
[19:03:17 INFO]: [Skript]  - skript-placeholders v1.7.1 (https://github.com/APickledWalrus/skript-placeholders)
[19:03:17 INFO]: [Skript]  - skript-yaml v1.7.2
[19:03:17 INFO]: [Skript]  - skript-reflect v2.6.3 (https://github.com/SkriptLang/skript-reflect)
[19:03:17 INFO]: [Skript]  - SkBee v3.20.0 (https://github.com/ShaneBeee/SkBee)
[19:03:17 INFO]: [Skript]  - SkRedis v2.3.0+0939b1a
[19:03:17 INFO]: [Skript] Installed dependencies:
[19:03:17 INFO]: [Skript]  - Vault v2.17.0
[19:03:17 INFO]: [Skript]  - WorldGuard v7.0.16-beta-01+ce4622f
Bug Description

Skript does not natively support the Integer data type. Even if we use 'integer' in a Skript file, Skript converts it to a Long. This hasn't been a major issue so far because the data was only circulating within Skript itself.

However, PersistentDataType is strict. so Long and Integer are strictly distinguished too; if you try to read an Integer PDC stored under the key 'custom:ABC' using the Skript syntax persistent integer data tag "custom:ABC" of player, you will encounter a strange runtime error: The data in tag 'custom:ABC' was of type integer, not the expected type integer. This happens because Skript is attempting to read an Integer PDC as a Long.

Fortunately, the reading issue can be somewhat bypassed without runtime errors by using 'number' instead of 'integer'.

The real problem, however, occurs during write operations.
If Skript forces the 'custom:ABC' tag (originally written as an Integer) to a Long and overwrites it, other plugins will no longer be able to find the 'custom:ABC' PDC as an Integer type. This will lead to serious compatibility issues when handling PDCs between different plugins.

Therefore, even if Skript treats integers as Long internally, it is necessary to strictly adhere to each specific data type when it comes to PDC.

Expected Behavior

Skript must respect PDC's original data types. (maybe this issue doesn't affect Integer only, can be more, but I didn't test other things)

Steps to Reproduce
  1. ready entity/item anything with PDC data(PersistentDataType.INTEGER)
  2. read that PDC (ex. set {_temp} to persistent integer data tag "PDC_TAG" of entity/item)
  3. runtime error.

and can be compatibility issue with other plugins that read PDC.

Errors or Screenshots

No response

Other

https://discord.com/channels/135877399391764480/138027100593455104/1497534447648505898
if you need some info, check this discord(skUnity) chat logs, it's conversations regarding this

Agreement
  • I have read the guidelines above and affirm I am following them with this report.
Lingua principale
Java
Stelle
1.3k
Fork
456
Merge medio
4g 10h
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SkriptLang/Skript

Tutte le issue di SkriptLang/Skript

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.