Jump to content

DavidM

Members
  • Posts

    1830
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by DavidM

  1. I thought you meant to create a custom health bar for the player... You are being rather vague. If you meant to create a health bar that hovers on each EntityLiving, subscribe to RenderLivingEvent. If you want to show the health of the mob the player is looking at as a screen overlay (like WAILA and DamageIndicator), do a ray trace to detect the entity the player is looking at and display its health on the GUI you've created.
  2. The point of that tutorial is not for you to follow step-by-step, but rather for you to learn from it and be able to create your own dimension with custom world generation. After reading the tutorial, you should be able to achieve what you want to do (overworked-like generation).
  3. http://jabelarminecraft.blogspot.com/p/minecraft-modding-custom-dimension.html
  4. He meant translating book content on the client side. the content of a vanilla book always stays the same can cannot be localized client-wise.
  5. Create an screen overlay. Subscribe to RenderGameOverlayEvent and do your rendering.
  6. There is nothing you can do about translating vanilla books. The content of vanilla books are stored in the NBT of the stack, and the book will not auto-localize its content when opened by a player. You can, however, create your own custom item book that opens a custom GUI when right clicked in hand. This will allow you to add translations. Doing so doesn't make much sense, as the sole purpose of localizations is to allow client-specific translation.
  7. As stated in the last section of the first post of the rules, post your entire debug log (logs/fml-{client/server}-latest.log for versions before 2629).
  8. 1. You didn't put anything in the result of your json recipe. 2. You still hasn't fix ItemBase. 3. Recipes, models, textures, etc should be in the appropriate subdirectories of the folder resources/assets/<modid>. You have recipe json files under main/java, which should never be the case. Move it to the appropriate subdirectories of the folder resources/assets/<modid>.
  9. ... Care to elaborate? Last time I checked, Minecraft is a 3D game.
  10. ItemStack#damageItem. Also, you still haven't fixed the "firing on both sides" problem.
  11. Do not download mods from sites like 9minecraft. They are illegally redistributing mods and can potentially edit mods and turn them into malwares.
  12. Someone's been meming around with Leeroy ; ) As far as I know (correct me if I'm wrong), the NBT structure of pages in a book is not simply a list of strings. The page structures in the NBT of a written book is something like: ["{\"text\":\"Text on page 1\"}", "{\"text\":\"Text on page 2\"}"] As you can see, the page structures are similar to that of a json object, but represented in the form of a string. Therefore, instead of just appending the content to the NBT list, try adding strings in the format shown above. The code should be something like: nbtList.add(new NBTTagString(String.format("{\"text\":\"%s\"}", pageText))); // Adds a page to the book. "pageText" specifies the text on the page. I am pretty sure there are other alternatives, with which I'm not familiar, to creating a written book; however, I cannot name any on the spot. Sorry. P.S. 兄弟看逗鱼时刻吗?
  13. VALUES.length is equal to 4, which, after multiplying and dividing by the same constant, still equals to 4. Let's say we set the TICKS_PER_STAGE constant to 10, in which case VALUES.length * TICKS_PER_STAGE equals to 40. 40 divided by TICKS_PER_STAGE (10 in this case) is 4, which is out of bound for your enum. However, if you change the return statement in your clampTickCount to: return MathHelper.clamp(ticksSinceCreation, 0, (VALUES.length * TICKS_PER_STAGE) - 1); , it will clamp everything into the range of [0, 39]. Now, the maximum return value is 39, which, after being divided by TICKS_PER_STAGE (10 in this case), is 3. This matches the highest dragon growth stage in your enum. TL;DR:
  14. public static int clampTickCount(int ticksSinceCreation) { return MathHelper.clamp(ticksSinceCreation, 0, VALUES.length * TICKS_PER_STAGE); } public static EnumDragonLifeStage fromTickCount(int ticksSinceCreation) { return VALUES[clampTickCount(ticksSinceCreation) / TICKS_PER_STAGE]; } Your enum has only 4 elements; therefore, the maximum value for the index can only be 3. However, in your clampTickCount, it clamps the value as if there are 5 elements in your enum (hint: off by one). Note that MathHelper#clamp is inclusive on both the min value and the max value.
  15. 1. Define "not working". 2. Currently, your code triggers twice when the player right clicks (fires once on both side). Check if the world is on the desired side before executing your code. 3. Stop using ItemBase and IHasModel. They are bad practices. 4. float dmg = 20.0f; // x dmg playerIn.setHealth(playerIn.getHealth() - dmg); //Deal x DMG Unless you are intentionally setting the player's health to a lower value instead of damaging the player, use Entity#attackEntityFrom instead.
  16. Report to the author(s) of the mod(s).
  17. ... Maybe you should, you know, read the error? It is telling you exactly what to do.
  18. No. The author has to do it. You can try reporting to the author about it, but I doubt such an old project is still being maintained.
  19. This kind of reminds me of the Fossils and Archeology Revival mod. Sounds fun though. I especially like the caring for creature idea; it brings a lot of liveliness to the game
  20. Do you mean setting the block to face the player when placed down? Override Block#getStateForPlacement and return the blockstate of facing in the player's direction. Also change the variants in the blockstates json to match your rotation. For reference, look at how the vanilla furnace handles it.
  21. 1. Stop using ItemBase. 2. You are initializing your items in init. Don't do this; initialize them in the item registry. 3. You are currently manually adding recipes via java, which is not recommended. Use json instead. 4. Json recipes unter the recipes folder are registered automatically. You don't have to link them. 5. static Object[] craftTaco = { " # ", "#CO", "CCC", Character.valueOf('#'), Items.COOKED_BEEF, Character.valueOf('C'), corncobname, Character.valueOf('O'), Blocks.LEAVES }; ... Why Character#valueOf? Just use character literals normally.
  22. If the behavior is to be implemented with a new item, prioritize overriding Item#itemInteractionForEntity over creating an event subscriber. If for some reason the "overriding Item#itemInteractionForEntity" cannot be implemented, create an event subscriber for PlayerInteractEvent.EntityInteract.
  23. There is no need for events. Override Item#itemInteractionForEntity in the class of the item you want to use to heal (get the target (EntityLivingBase) from the parameters ). Apart from that, the code you posted is not a valid event subscriber. Event subscribers take in exactly one parameter (event type).
  24. If it is a syntax error, try fixing it yourself; if it is a runtime error, post the error as well as your code.
×
×
  • Create New...

Important Information

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