• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Thank you very much! With your help it works now for every mob I tested. My code now: @SubscribeEvent public static void onInteractEntity(PlayerInteractEvent.EntityInteract event) { PlayerEntity player = event.getPlayer(); Item usedItem; if(event.getHand() == MAIN_HAND) { usedItem = player.getHeldItemMainhand().getItem(); } else { usedItem = player.getHeldItemOffhand().getItem(); } if(!player.world.isRemote) { if (usedItem == ModItems.HIGHLIGHTER.get()) { Entity target = (Entity) event.getTarget(); if (target.isGlowing()) { target.setGlowing(false); } else { target.setGlowing(true); } } } }   Thank you very much!
    • OK, so if I understand you correctly, your point is that the client TileEntity has an Inventory but it's actually useless.  You can sync it if you like, and vanilla sometimes does, but it's not used for anything. When the player opens a container, the client container gets a temporary inventory which is synched with the server via the container, not via the tileentity.  Vanilla usually creates a new temporary inventory, but if the mod wants to use the useless client inventory in the TileEntity instead of creating a new temporary inventory, it may as well.   When I tried it that way in 1.12.2 it led to occasional random visual glitches under stress testing.  The problem was particularly noticeable for TrackedInts being stored in the TileEntity (for example - the furnace burn progress would jump back and forth because it was being updated simultaneously by the GUI (container) packets and the TileEntity update packets), but also occasionally occurred for items in the inventory.  However if you don't dirty the server TileEntity, or the TileEntity update packets do not synch the inventory (for example you are using a Capability), then I imagine it's not a problem.   I can't think of any reason a client TileEntity would need to know the contents of the Inventory, unless it is changing its rendering like the campfire does.  In which case using the client tileentity as the container inventory would be a bad idea, i.e. because the tile entity update packets and the container modifications would clash with each other.  The worst symptom would be visual glitches I imagine.   -TGG      
    • There is no API. I would recommend you make your own screen which is reachable from the mod options. To do this use ModLoadingContext#registerExtensionPoint with ExtensionPoint.CONFIGGUIFACTORY, which allows you to register your own configuration GUI.
    • 1.8 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • Correct. You have not even explained this to them. Instead you said "do this". They copied it, no idea what is going on potentially. This is not how learning works. If they have basic Java knowledge, this is trivial to figure out.
  • Topics

  • Who's Online (See full list)