I would like to suggest an improvement to the Minecraft Bedrock Script API related to minecraft:xp_orb entities.
Currently, scripts can detect and manipulate XP Orbs, but there is no stable API that allows developers to directly query how much XP is stored in an individual orb.
It would be very useful to provide a property or method such as:
const xp = orb.experience;
or:
const xp = orb.getExperience();
It would also be important to have a stable API for creating an XP Orb with a specific amount of XP, for example:
dimension.spawnXp(location, amount);
where amount represents the exact amount of XP stored in the new orb.
This would allow creators to develop systems that combine multiple XP Orbs without losing XP. For example:
Orb A = 3 XP
Orb B = 7 XP
Result:
One Orb = 10 XP
Currently, it is possible to try to determine the value of an orb indirectly by measuring the player's total XP before and after collecting it. However, this method can be affected by XP received from other sources and does not allow XP Orbs to be handled reliably.
An API that allows developers to directly read the XP value of an XP Orb and create an orb with a specified value would make it possible to implement XP merging, storage, transportation, and management systems much more reliably.
Thank you for considering this improvement to the Bedrock Script API.
0 Comments
Please sign in to leave a comment.
Post a new comment: