After placing a dispenser block I want to transfer an item from my hotbar into the dispenser, I have the following code:
this.mc.player.inventory.currentItem = this.shulkerSlot;
TileEntity dispenser = this.mc.world.getTileEntity(dPos);
ItemStack shulker = this.mc.player.getHeldItemMainhand();
dispenser.setInventorySlotContents(1, shulker);
this is meant to place the item that is in my hand into the dispenser at slot 1, however the method setInventorySlotContents() doesnt seem to exsist in that context
thanks
the error is The method setInventorySlotContents(int, ItemStack) is undefined for the type TileEntity