Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

J3ramy

Members
  • Posts

    55
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

J3ramy's Achievements

Stone Miner

Stone Miner (3/8)

0

Reputation

  1. Okay I try to find a solution. Thank you
  2. That's not a good thing to do? Do you know the MCP names for those methods?
  3. Weird. The only method that I get suggested is TileEntity#readTileEntity() ...
  4. Ok thanks but there is no save and load method if I type TileEntity.save() TileEntity.load() //or tileEntity.save() tileEntity.load() Did I misunterstand you?
  5. How can I get and save the tile entity nbt in my block class? Do you have any tutorial or minecraft example? Because in onBlockActivated you don't have access to any Compund Tag.
  6. You mean save it in the tile entity nbt itself or where do you mean? Because if I destroy the block, the tile entity gets destroyed as well right?
  7. Good morning, I am trying to move a block and his attached tile entity by right-clicking it, because I need the same tile entity data but at another position. Right now I am moving the block one to the north. Then I get the tile entity at the new position and assign the value of the old tile entity to the new one. It works, but is there an easier way to solve this without a lot of reassigning? I tried TileEntity#setPos as well but it doesn't work. This is my code:
  8. Nice thank you. It works perfectly
  9. Nice thanks. I changed the line to Network.INSTANCE.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) player), new PacketSendName(tileEntity.getName())); and it calls the handler method. But how do I now pass this to the screen container class?
  10. The error is "Simple Channel is not compatible with NetworkManager", so it means that the second parameter is the wrong type but I don't which variable I should pass instead of Network.INSTANCE: Network.INSTANCE.send(new PacketSendName(tileEntity.getName()), Network.INSTANCE, NetworkDirection.PLAY_TO_CLIENT);
  11. Hello, I am trying to send a string name (which is stored in NBT data in my tile entity) to the client screen, but I don't know where/how I should call the send network package and how to get it in the screen class. My Packet class: I can access the name from the tile entity via tileEntity.getName() In my screen class I just call this.container.getTileEntity().getName() to get the name. Saving the name with nbt works fine. I just want to know how I can get the name from the tile entity In my block class I called Network.INSTANCE.send(new PacketSendName(tileEntity.getName()), Network.INSTANCE, NetworkDirection.PLAY_TO_CLIENT); but it is an error because SimpleChannel is not compatible with NetworkManager. I don't know which variable I should pass instead. And I questioned as well: Would it make more sense to pass a position parameter, so it can get to the right player or screen? Thanks for your help EDIT: Maybe you can name an example where Mojangs is using it in that way ^^
  12. Nice good to know. Thank you both. In general, will the tick methods only be called when the chunk is loaded or even when it's not loaded?
  13. Hey guys, I don't have a problem, but I want to know if using the tick method in the tile entity affects the game's performance. Of course it depends on what you do in the method but I want to know it in general and if I can use a lot of blocks then. Additionally, I update the block state in a special tick interval. And I dont't know if this is an efficient solution to execute things after some amount of ticks. It looks like that: Thanks for the feedback!
  14. Okay thanks. I already did that. I just was not sure if there is an easier solution
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.