Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

RafaMv

Members
  • Joined

  • Last visited

Everything posted by RafaMv

  1. Hey guys, I would like to render a mob that will have different modelbases. Just imagine a robot that can change its arms. However, I don't know how to render the models separately (and properly). Does anyone have a good idea how to do that? I tried this:
  2. I think I got it working, although I have a question. It just works if I don't return anything in the onMessage() method. If I return the "massage", it says that an integer is (obviously) bigger than a byte, and the game crashes. Should I leave it null?
  3. Hey guys, I'm wondering how can I sync to the server-side a block that was removed on the client-side using a GUI?
  4. I think you missed the blend function. Try adding something like "GL11.glBlendFunc(sourceFactor, destintationFactor)" after glEnable blend, it should work I guess.
  5. Now I got it working. I don't know why, but my mobs were stopping after moving to the last player position. I think it was priority. Anyway, my AI list is now:
  6. Hey guys, recently I realized that vanilla mobs have a little delay when they are following a player to attack. It is easy to see if you just walk on circles around the mob. I created a new hostile mob and it seems that this delay is very big, something like a wolf, which would stare at you for some seconds before attacking. Does anyone know where I can fix this behavior by reducing this delay?
  7. Actually its working, but its always good to check if I am doing it right, specially because I haven't worked too much with entities yet. I obviously missed this method when I was looking into the EntityAgeable class. D:
  8. I created a new class similar to the EntityAgeable class, but with more growth stages. Therefore, to adjust the bounding box I am calling the super.setSize() every time that the mob reach a certain age (I'm using the "ticksExisted" from the Entity class to check this).
  9. Hello guys! I am wondering, the super.setSize() in the entity class should run in server or client? I did some tests before and I think it should run in client only, is that true? Thanks!
  10. Thanks for all your responses guys, but I have to rethink what is my goal. Actually, what I would like to make is: a mob that can change colors depending on a float value of the entity class. therefore, I would get this value and change the color of the secondary texture using glColor4f, but i would keep the primary texture unchanged. Just imagine a dog that have spots, for instance. To be honestly, I could do lots of different textures for each mob, but it would be a pain...
  11. Hey guys, I was wondering is there a way to use 2 textures on the rendering? Let's say that I have a mob and I would like to use one texture for the body and another texture for the head. I tried everything, but the first texture is always replaced by the other one...
  12. Found my mistake. I was trying to check the id after checking the tileentity at position (x, y, z) which is obviously null. Ops! However I am having trouble with the getValues from the entity class. For some reason the values that I'm getting is from the server side, which are not updated (different values compared to the client). Only the getHealth() and getSpeed() are correct. Note: I'm using DataWatcher in one of these variables and it doesn't work either. My common proxy: My client proxy: My main class:
  13. Hey guys, I am trying to create a GUI that opens when I click on my custom entity. This is a basic GUI, which will show some information about the entity. This is what I've done so far: Gui Class: How I am trying to open this guiscreen: Gui Handler: Am I missing some thing? Btw, any idea how can I have access to the entity?
  14. I found my mistake! I was using the client side of the onUpdate() method to run the super.setSize(). I should have called it on the server side of the living update, just like vanilla!
  15. I don't know why, but the boundingBox doesn't change... Do I need something like a datawatcher for this?
  16. Hey guys, I'm having some trouble to update my mob hit box. I created a custom growth system (which is working fine), so I can't use the vanilla class. I tried using the setSize() method, but it doesn't seem to work: How can I change/update the hitbox of a mob?
  17. I've already synchronized the id and stage. I am just trying to avoid the search in the hashmaps (or array) every rendering cycle. That's why I want to send a packet with the ModelBase only when the stage changes. But, to be honest I am very happy with the result that I've got so far.
  18. I like this array idea. I didn't use it before because not all id's have the same number of stages. But, let's say that I would like to use arrays, how can I send a packet with the ModelBase to the render class. I really have no clue how to do that.
  19. Hey guys, I'm having a bad time trying to optimize my tileentity rendering. What I'm trying to do is rendering another ModelBase inside a machine, depending on two value in the Tileentity class (ID and stage of rendering). I was able to achieve this but I really don't think that what I've done is the best way, because it is too expensive (I guess). Basically, I created a database by using a hashMap inside of another hashMap (hashmap<byte, hashmap<byte, ModelBase>>), then I just synced two byte values of the tileentity (the ID and Stage, which change every 300 ticks or so) and it worked perfectly. But, I think that's very expensive to access the database every rendering cicle. So, my first question is: Is that really expensive? (My hashMap would be 10 hashmaps of 5-10 models, for instance). If it is, how can I sync a ModelBase?
  20. Your gui is fairly large. Items popping out from your gui may be caused by a wrong xSize, or ySize. Make sure that you got these values right in the GUI class.
  21. No problem! Looking at the crash report you can see: So, I believe that you must have to define each rotation point, since you got a null pointer exception. I thought these rotations were (0,0,0) by default, but there aren't... That's good to know, haha.
  22. I see this twice: Not sure if it would crash though.
  23. Wow, for some reason it didn't work before. Now, it's working... weird.
  24. Hey guys, I was wondering how can I change the mob attribute, such as health or speed, after it has already been defined? I tried setBaseValue(), but it can only be call once, so i can't change any value by using this method. I tried setAttribute() as well, but it didn't work: "The method setAttribute(double) is undefined for the type IAttributeInstance".
  25. Thanks diesieben, it worked perfectly!

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.