Jump to content

Villager_31441

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by Villager_31441

  1. I am now sending a message to the clients when a mob changes its status. But how can I assign the status to the entity on the client? I have tried sending the entity UUID alongside the message but it appears the client only uses a numerical non-persistent identifier. Is there another way to find the correct entity?
  2. Noob here but from what I could find you'd create an event handler that listens for destroyed blocks using a handleBlockDestruction method. You'd then check if the event.entity has the correct pickaxe equipped. If so, you can iterate through the affected blocks. Should be all blocks with either x, y or z coordinate one greater or smaller than the destoryed one. Not sure about how to add the actual item to the game. For wireframing you can try to have all pickaxes affected at first. But you'll probably find some tutorials on how to create new items.
  3. Ah, now I got it. So I detect the state on the server and store them with a capability, send updates to the client and store them with the exact same capability. It's starting to make sense now. Thank you so much for your help and quick responses!
  4. Thanks a lot. Ah, I see. The new API requires a factory of type Callable instead of the class. So I send the state of all entities (or at least those with a positive state - as in they have levitation) to the respective client once they are being tracked. What would I do when the state of a currently tracked entity changes? I have to send it to all tracking clients. But is there a simple way to find out who that is or do I have to store which client tracks which entities myself? When I do notify the clients would I simply send a message via SimplImpl? Can I apply the state directly to the entity so that I can find out about it via entity.whatever() or do I have to find my own solution, e.g. store all the IDs of entities with a positive state in an ArrayList and then check if the entity is in there?
  5. So, I followed this guide on PlanetMinecraft about the capability system. What is still unclear to me: Is the guide still up to date or has a lot changed since then? What is that resource location in the capability handler pointing at? My IDE warns me that CapabilityManager.INSTANCE.register() is deprecated but it still appears in the official documentation. What is the new way of registering your capabilities? And I also cannot find anything about the mentioned tracking events. What are the respective functions called and how do I use them? EntityLivingBase#potionsNeedUpdate also doesn't appear to be a thing.
  6. Is this page about Extended Entity Properties what your are talking about? It says that the system is deprecated but the favored Capability system doesn't sound at all like it would solve my problem. I am also having a very hard time understanding what is going on in these code snippets. Do you know of any more detailed explanations than the docs? I consider them very confusing.
  7. Yeah. I figured the id is bad practice. Makes it hard to read, too. I've seen a bunch of code examples using something like Potion.jump_boost ect. but IntelliJ tells me that no attributes of that sort exist. So what would be a good way to refer to "minecraft:levitation" in code? Ugh, I was really hoping for an easier way. I am just trying to create a very simple mod that flips the player/mob model around when someone hits the ceiling under the levitation effect. Maybe I can just detect upward movement instead of the effect? But then I wouldn't know how to differentiate between floating and jumping against a block. So I guess I will have to learn how to efficiently do the networking stuff. Thank you for your help thus far!
  8. I am. Thanks. Just tried that out. It doesn't work for the mobs nor the player. It did detect a newly summoned Zombie Pigman with {NoGravity:1} NBT data though. So I suppose it does just that and nothing beyond.
  9. From the error trace it appears the crash is due to a programming mistake in CodeChicken Multipart (aka Forge Multipart). Try removing that mod and all dependent mods. Or check whether an update is available.
  10. I thought about that as well. The client should know about the effects on the player character but not necessarily any other entity. How would I go about retrieving that information from the server? Especially with the check happening every tick. Do I have to send a message to the client using SimplImpl whenever a mob in its maximum view distance receives or runs out of a potion effect?
  11. Hello there. I just started with creating mods for Minecraft. I am trying to check for all entities that have a specific potion effect and change some stuff in how they are rendered. The code works absolutely fine with players but not for mobs at all. I found out that it is this piece of code. @SubscribeEvent public void onRenderLiving(RenderLivingEvent.Pre event) { LivingEntityBase = event.entity; Potion levitation = Potion.getPotionById(25); if(levitation != null && player.getActivePotionEffect(levitation) != null) { // do stuff } } The code in the if-statement is never executed for any entities other than players. I also tried iterating through .getActivePotionEffects() but it never finds any effect at all. Logging revealed that the entites will be passed to the function though. So it must be due to .getPotionEffect() always returning false on mobs. Am I using the API wrong? And if so, how would you check whether a mob has a potion effect?
×
×
  • Create New...

Important Information

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