What it detects
This analyzer identifies three types of deprecated API usage:- Deprecated methods - Method calls that have been replaced in PM4/PM5
- Deprecated classes - Classes that have been moved or removed
- Deprecated constants - Constants that no longer exist
Common deprecated APIs
Level to World migration (PM4)
PocketMine-MP 4.0.0 renamed “Level” to “World” across the entire API.Player messaging methods (PM4-PM5)
Several player messaging methods were renamed for consistency.Metadata system (removed in PM4)
The metadata system was completely removed in PocketMine-MP 4.0.0.AsyncTask local storage (PM5)
Thread-local storage methods were deprecated in favor of static class properties.Entity visibility methods (PM5)
Resource methods (PM5)
Item and enchantment changes (PM5)
Item equality methods
Enchantment compatibility
Full list of detected deprecations
The analyzer detects 74 deprecated methods, 8 deprecated classes, and 1 deprecated constant:View all deprecated methods
View all deprecated methods
getLevel,setLevel,getLevelNonNull→ Use World methodsteleportImmediate→teleportaddTitle,addSubTitle,addActionBarMessage→send*equivalentssendPopup,sendTip→sendToastNotificationgetMetadata,setMetadata,hasMetadata,removeMetadata→ Custom storagegetPlayerExact→getPlayerByPrefixor custom lookuphidePlayer,showPlayer,canSee→ Entity spawn/despawn methodsgetResource,saveResource→ PHP file functions withgetResourcePath()- AsyncTask local storage methods → Static properties
canTick→getApplyInterval()getCollisionCubes→getBlockCollisionBoxesgetFullBlock→getBlock()->getStateId()equals→equalsExactorcanStackWith- Enchantment flag methods →
ItemEnchantmentTags toHTML→ Custom implementationgetMemoryUsage→Process::getAdvancedMemoryUsage()
View all deprecated classes
View all deprecated classes
pocketmine\level\Level→pocketmine\world\Worldpocketmine\level\Position→pocketmine\world\Positionpocketmine\level\Location→pocketmine\world\Locationpocketmine\level\ChunkManager→pocketmine\world\ChunkManagerpocketmine\level\format\Chunk→pocketmine\world\format\Chunkpocketmine\tile\Tile→pocketmine\block\tile\Tilepocketmine\metadata\Metadatable→ Custom data storagepocketmine\plugin\PluginLogger→ PSR-3 Logger
How it works
The analyzer uses PHP-Parser to traverse the abstract syntax tree (AST) of your code and:- Scans method calls - Checks both
$obj->method()andClass::method()calls - Scans use statements - Detects deprecated class imports
- Scans fully qualified names - Catches inline
\pocketmine\level\Levelusage - Scans constants - Identifies deprecated constant references
Each detected issue includes the line number, deprecated API name, replacement suggestion, and the API version when it was deprecated.
Example output
When the analyzer finds deprecated API usage, it reports:Configuration
Disable this analyzer inretina.yml:
See also
PHPStan analyzer
Advanced static analysis with PHPStan integration
Thread safety analyzer
Detect thread safety violations in async tasks