Pocketmine-mp: OfflinePlayer inventory access

Created on 21 Jan 2019  路  1Comment  路  Source: pmmp/PocketMine-MP

Description

Ability to access and modify the OfflinePlayer inventory

Justification

Scheduled awards. Asynchronous item manipulation. Late transactions. Dozens of reasons; XenForo trophy system provides some nice example usages.

Alternative methods

Edit NBT directly? It is not even documented...

API Enhancement

Most helpful comment

Amusingly enough OfflinePlayer currently doesn't even give you access to the NBT at all, so you couldn't do that anyway. I'm gunning to get rid of all the "API"ish NBT in the core for future releases, so we don't want users doing that.

The internal architecture of inventories is too complicated to permit this currently (due to cyclic dependencies between inventory and its holder).

>All comments

Amusingly enough OfflinePlayer currently doesn't even give you access to the NBT at all, so you couldn't do that anyway. I'm gunning to get rid of all the "API"ish NBT in the core for future releases, so we don't want users doing that.

The internal architecture of inventories is too complicated to permit this currently (due to cyclic dependencies between inventory and its holder).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

beetree picture beetree  路  3Comments

sergeysova picture sergeysova  路  3Comments

MisteFr picture MisteFr  路  3Comments

Muqsit picture Muqsit  路  3Comments

Muqsit picture Muqsit  路  3Comments