Jump to content

warjort

Members
  • Posts

    5420
  • Joined

  • Last visited

  • Days Won

    174

warjort last won the day on January 6

warjort had the most liked content!

Recent Profile Visitors

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

warjort's Achievements

Reality Controller

Reality Controller (8/8)

551

Reputation

  1. By the way, if you are concerned about lag, you can always throttle your tick handling. Something like: if (entity.tickCount % 20 == 0) { // do processing once per second }
  2. A quick search finds this example in the Botania mod updating tags during inventoryTick, so my concern about that is probably not correct? https://github.com/VazkiiMods/Botania/blob/0568ec726bd42c506cdfa00705159dbe9b897b46/Xplat/src/main/java/vazkii/botania/common/item/equipment/tool/VitreousPickaxeItem.java#L90
  3. If you want help with your code, put a reproducable example of your problem on github. Not random and incomplete code snippets out of context in this forum. We need to see how the code fits together and maybe try it for ourselves if the problem is not obvious I am not very familiar with inventoryTick and what rules apply to it. It is mostly used by Mojang to do animation related stuff on the client, But one place they do use it on the server is to update MapItem information. This does not modify the actual item, instead it updates information stored elsewhere. It would not suprise to learn that modifying an ItemStack while the game is iterating over the inventory causes it to become very confused. The tags on an ItemStack form part of its "identity". But I don't know that for sure.
  4. It is very tiresome posting this on every thread in this forum: If you want help with your code, put a reproducable example of your problem on github. Not random and incomplete code snippets out of context in this forum. We need to see how the code fits together and maybe try it for ourselves if the problem is not obvious. I don't actually know because I never tried it, but I bet using EntityType.spawn() for an experience orb sets the experience value to 0? You should create the ORB yourself and then call serverLevel.addFreshEntity(). See for example Animal.finalizeSpawnChildFromBreeding() For you other question, maybe? if pTarget instanceof Monster or maybe you want to get check if the mob is targetting the player using Entity.getTarget ?
  5. That means put the build of a project on github that demonstrates the issue. Not random and incomplete code snippets out of context. We need to see how the code fits together and maybe try it for ourselves if the problem is not obvious. Anyway, If that really is all your code, you are missing the EntityAttributeCreationEvent for your mob. https://forge.gemwire.uk/wiki/Making_Entities#Entity_Attributes You seem to have a static method for this called setAttributes() in your code - but I guess nothing calls it?
  6. Also if you want help with your code, you need to post reproducable examples of the problem on github. Not small snippets of code in the forum that contain that have no context.
  7. You cannot access config during registration. https://forge.gemwire.uk/wiki/Stages_of_Modloading https://forge.gemwire.uk/wiki/Configs As I said on your hijack of the other thread, this question has been asked and answered many times before. You can use search instead of posting repeat questions. In your case, that config needs to be a server config so that client and server agree on what the durability is. Otherwise you will get inconsistencies. Basicially the value won't be known until the player joins the server, either loading a world in single player world or joining a remote server. That also means different single player worlds can set different values (like how game rules work). In your registration of the item you should set it some default value so the game knows the item has durablity. It does not matter what value you set as long as it not zero which would mean the item has no durability. That value won't actually be used because you have overridden the method to get the value from somewhere else.
  8. Those are the old forge names from minecraft/forge 1.16 and before. You want mojang official names for those classes which Forge switched to by default in 1.17 PlayerEntity -> ServerPlayer World -> Level If you are going to use tutorials you need to make sure they are for the version you are developing with. Mojang tend to have lots in "churn" in their codebase. I believe there used to be a bot on Forge's discord that let you look up the changed name to help people migrate from 1.16 to 1.17 If it still exists (I don't use discord so don't know) it is probably out of date by now but might still have some use?
  9. Don't post code snippets out of context in the forums, put a complete example of your problem on github where we can see everything. But if you are posting compiler errors, you want a learning java forum not a minecraft modding forum.
  10. Put a reproducable example of your problem on github.
  11. pTarget.isAlive() ? There is also this event for when entities die, telling you how they die and what caused it: https://github.com/MinecraftForge/MinecraftForge/blob/817e20821d04225e2b39e2ce64be9b70c8ddfa27/src/main/java/net/minecraftforge/event/entity/living/LivingDeathEvent.java#L16
  12. Read the FAQ at the top of the forum about fixing graphics drivers.
  13. There is no error in that log. But I can see you are using optifine as well. You can't use optifine/rubidium/embedium together. You have to choose one major graphics overhaul mod. If you are just dumping large numbers of random mods in your mods folder don't do that. Add mods individually or in small groups and test them so you know which mods cause problems.
  14. Please don't dump code snippets in the forum. Post complete reproducable examples to github so we can see everything in context. e.g. you don;t show your item code that triggers all this You shouldn't need to do any custom networking for this unless your processing is none standard. That item "use" method should get called on both the client and server. From the server you can use ServerLevel.sendParticles() See for example PotionItem.useOn() which calls sendParticles when isClientSide is false - there are many other examples in the vanilla code https://forge.gemwire.uk/wiki/Particles#Spawning_Particles To answer exact question: Players are Entitys. Minecraft serializes them over the network using their entityId. But the player is often implicit in the connection. Its only when another player is referenced that these ids get sent.
×
×
  • Create New...

Important Information

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