Jump to content

Dzuchun

Members
  • Posts

    98
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Dzuchun

  1. CowModel class and, I think, all the classes implementing EntityModel class (not sure) Also, check blockbench.
  2. https://mcforge.readthedocs.io/
  3. isRemote is not a static field, which means you need get it for a world object instance, not for a world class. All entity objects have a "world" field, which contains a world they exist in. So, in you context you should check for p.world.isRemote. And yea, this is a pretty basic java, you need more practice to start modding.
  4. I have no idea why, but it works now. Seems like all i've changed is canBeCollidedWith return value to true.
  5. Repo is private or does not exist.
  6. I looked through your code, and I feel like you need to check IBlockReader::rayTraceBlocks and ProjectileHelper::rayTraceEnitities methods.
  7. If blender is too hard for you, you may use Blockbench.
  8. Of course, I set the size, that's why Also, I call recalculateSize method inside entity constructor (after calling superclass constructor). It seem to recenter bounding box as well.
  9. It's a several matrix objects that forming a stack. Each matrix defines some translation (movement) and rotation within all 3 axes. Stack form is very useful, because it allows you to divide massive and unreadable math into more easy-to-understand operations. You should not create empty matrix stack, it makes no sense. In any render method matrixStack is passed or you can perform same operations with GL* methods(not sure). All you need to do is .push(), then translate and rotate where you need to and .pop() in the end. push-pop may be done inside as well. As Novârch said, EntityRenderer:renderName shows perfect example of rendering text in world.
  10. I'm creating a custom entity now. I've overriden attackEntityFrom(DamageSource, float) method for it, but it seems like it is never called, even if I hit my entity in creative mode. Then, for debug purposes, I subscribed to some client tick event and logged Minecraft.objectMouseOver.getType().toString(). As expected, my entity is just ignored by raytracing. F3+B overlay shows a perfect 1x1x1 box around my entity, that I obviously should hit. Entity exists on both client and server (I can /kill it and it's rendered). So, here comes a question: what should I define for raytracing to notice my entity?
  11. Please, keep this forum in English. 1.8.9 is no longer supported, sorry.
  12. Actually, if you really need to send entire capability with network package, you may write your capability into CompoundNBT tag and then write this tag into PacketBuffer. But as poopoodice said, avoid excess synchronization.
  13. Here you don't need this to execute something on button click. Listening is already handled by LWJGL (not sure), so all you need is to specify function that should be executed once button is pressed. (p_213070_1_) -> { this.minecraft.displayGuiScreen((Screen)null); this.minecraft.mouseHelper.grabMouse(); } Here is this function. This format is called lambda-expression. Check source code for more context, this code is located at IngameMenuScreen class.
  14. For any diagnostic you should provide debug.log file. Please, don't directly copy it's content here, because it can be several thousand lines long. File is located in log folder. Also, check pinned post.
  15. Actually, no. Probem left the same. Minecraft generated village in any chuck (which you can see in /locate command output). So, now you still need to configure generation. After burrying a little inside vanilla code I found protected boolean func_230363_a_(ChunkGenerator, BiomeProvider, long, SharedSeedRandom, int, int, Biome, ChunkPos, C) at Structure class. You may try to override it and return true only if some small probability happens (not very good at English). I think, these two ints in the middle are chuck coordinates. P.S.: Man, this looks awesome! EDIT: I feel like this may help to reduce actual generation, but your structure still will be detected at every chunk.
  16. Here is a complete Blockstate file structure
  17. RegistryEvents are fired at MOD bus. Check if your class gets loaded at all. To ensure it happens, you may create black method and invoke it from your mod initializer. Read sign.
  18. This means that after 1 tick your task gets interrupted and another one selected.
  19. Here is an example of button from IngameMenuScreen class: this.addButton(new Button(this.width / 2 - 102, this.height / 4 + 24 + -16, 204, 20, new TranslationTextComponent("menu.returnToGame"), (p_213070_1_) -> { this.minecraft.displayGuiScreen((Screen)null); this.minecraft.mouseHelper.grabMouse(); })); This works for sure, find the difference.
  20. Use IBlockReader.rayTraceBlocks(RayTraceContext) method. It does exactly what you need. (World implements IBlockReader) Example of usage is at Entity::pick
  21. I used to experiment with creating custom entities at 1.15.2, but seems like not much changed since then*nevermind*. Here is my repository. Please, do not use it as manual, it's terrible in fact. All you need about AI is at HappyDolphinEntity class, which defines a pink horned flying dolphin that eats flowers accidentally (don't ask me why). In that class you may see my own WanderingGoal, (because I was to stupid to use existing one, yea) and all sort of things I made to get it working. I'm really sorry for posting this code here, and once again, THIS IS NOT A MANUAL. Read sign.
  22. You may use lambda-expression for that. It won't help you at all, but you'll get rid of some excess code. Minecraft has FollowOwnerGoal for you to have a template (it requires TameableEntity). The problem may be that you set a new path every tick. Stock FollowOwnerGoal does it every 10 ticks. (not sure)
  23. Where from do you execute setAttributes method? It's static, so it does not override something. Also, you'd better provide full source code(using github, for example), because usually errors are in the places you do not expect them
  24. Yeah, you got right fields. It does, but here's what I found in same class: public GenerationStage.Decoration func_236396_f_() { return field_236385_u_.get(this); } So, you may try override this method for your structure and return GenerationStage.Decoration instance (they are public, don't worry).
×
×
  • Create New...

Important Information

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