The API could use insertNewOject and getObjectAttribute functions. I can insert items into a players inventory, but not objects due to the attribute tag not being accessible.
insertNewOject and getObjectAttribute functions
-
- English
- notabadminer
- Thread is marked as Resolved.
-
-
The API could use insertNewOject and getObjectAttribute functions. I can insert items into a players inventory, but not objects due to the attribute tag not being accessible.
Sorry, but I do not understand:
1) Functions of what? Or in other worlds, as methods of which class?
2) Which objects? Attribute in which sense?
-
The API has player.getInventory().insertNewItem(itemID, itemVariation, amount); This does not work for adding objects. It adds item ID:43, Variation:0, Name: objectkit but the item is blank
testItem.toString() shows:"Item: Item - id: 43 texture: 1 stack: 1 value: -1.0 status: 0 attribute: obj_9, name: objectkit"
I am assuming all that is required to add the workbench to inventory is having a way to assign the attribute "obj_9"?
-
The API has player.getInventory().insertNewItem(itemID, itemVariation, amount); This does not work for adding objects. It adds item ID:43, Variation:0, Name: objectkit but the item is blank
testItem.toString() shows:"Item: Item - id: 43 texture: 1 stack: 1 value: -1.0 status: 0 attribute: obj_9, name: objectkit"
I am assuming all that is required to add the workbench to inventory is having a way to assign the attribute "obj_9"?
I tried .insertNewItem((short)43, 0, 1); and in fact an item is added but without any icon in the inventory display and with a name of "---". Dropping it results in a crate being dropped.
I also added a regular workbench to the inventory (via the usual game operation, which is of course shown correctly in the inventory) and through debug inspection I see differences in obfuscated fields (not accessible through the plug-in API).
I assume the add item API is not complete yet and an additional parameter would be required to specify the item sub-type for types like "objectkit" with several sub-types.
-
Participate now!
Don’t have an account yet? Create a new account now and be part of our community!