Jump to content

MFMods

Members
  • Posts

    370
  • Joined

  • Days Won

    13

Everything posted by MFMods

  1. yeah. i tried a lot harder than you did, trust me. keep the big one you already made and use it for item model. make two copies, delete bottom portion in one, delete top portion in the other and translate upwards.
  2. https://github.com/moonfather1/workshop_for_handsome_adventurer they're simply the best. better than all the rest....
  3. global loot modifier, i guess. you can ignore suggested drops, invoke target block's loot table with parameters that you specify.
  4. i gave up on double-sized blocks. it looks good but then you place a dirt blocks next to it and urgh, things become very dark. cut it up into two top and bottom parts.
  5. notify FD's author. it is unlikely he will see the report here.
  6. there is no code. you remove stitch event. if you're adding to vanilla block atlas, make blocks.json in src\main\resources\assets\minecraft\atlases\ . see client.jar for examples. if you have your own atlas... good luck with that. you simply can't use non-vanilla atlasses for some things like gui slots. if it's for drawing things manually ,look at PaintingTextureManager class and make one just like that.
  7. entityType.spawn() has a BlockPos parameter. you can't miss it. if you want to go with addFreshEntity, set the location (x,y,z) of the entity (there are set methods for it, i think i was setPosRaw). then, after that, call addFreshEntity.
  8. since you're new, i guess some positive words are in order: yes, you can use optifine as long as its version matches the game version you are running. find optifine for forge and put it into mods directory. now smart words: 1) look - i understand wanting optifine. i played on low-spec machine for many years. but as of 1.16 we have performance mods that are better than optifine and don't break everything everywhere. move to 1.16 or 1.18. 2) whatever mods you think are the reason for staying at 1.10, there are alternatives for 1.18. trust me, move to 1.18 or higher.
  9. i don't see a direct cause there. someone else might but i wouldn't hold my breath. i'd remove java, reinstall java ( https://adoptium.net/ )and then try again. try vanilla launcher first.
  10. you need to slow down. you can't just write two screens worth of mess and ask why it doesn't work. make a short event that does minimal modification of the item. then - only then when a minimal event works fine, write a real thing. you wrote up there "event.setCanceled(true);" - are you sure you want that? are you sure you know what it does? you wrote " event.getInventory().setItem(1,output); " why would you do that? test that in a minimal event without all that mess, you'll see that it doesn't do what you expected.
  11. maybe it does? or it doesn't? why did you expect to see result without specifying the location of the new entity? addFreshEntity should work. alternatively, entityType.spawn() will work too.
  12. most of the time you don't need networking and can rely on the game. if you want to create an apple item on the ground, just pop one itemstack on the server side, game will take care of the rest. if you need to hurt or heal the player, just do it on server side (isRemote == false) and don't worry. so when do you need networking? well once, i wanted to show a toast (the notification thing in top right corner) when player achieved some milestones. here's the code: (handled an event) if IsRemote==false and my condition is fulfilled: send message to current player's client instance to show the toast increase counter by +1 and mark my piece of game save as dirty see the code above - last line (saving data) makes sense only on server. but trying to show a toast on server? not only does it not make sense but it would crash the game because that part of the game doesn't exist on server instance. that was a server to client message. if a player clicks on a button in your gui window, you need to send a client to server message because windows and screens don't exist on the server. all game logic must happen on server side. client just holds copies of some things for the purpose of drawing things.
  13. yeah, i should have probably been more verbose. yep, nbt in item stack is fine. yes, nbt in item stack is fine. it will persist through putting an item in chest, pulling it out, tossing it onto the ground and quitting and restarting the game. but it will not automatically be transferred to client where we need it in order to have property-dependent textures. still, if it's a simple property (number of bandage usages in this case), you should be okay by maintaining both client and server values in item use event.
  14. hmpf... crafting is good, shift-click is good. maybe you could have kept a base version but i can't say from the outside. that fill method seems weird. i didn't override it in my crafting tables. try without it.
  15. it's hard to help you because there is no question there. you can have you buttons within the gui background image (usually 256x256 png), there is likely room on the right side or bottom. make variants for hover and possibly for permanent states. i think mcjty has a gui tutorial on youtube, but the problem is that gui rendering has changed in 1.19.3 and then 1.20 so the code you see there won't work without changes. you might want to watch videos but take code from vanilla screen classes.
  16. relax, it's infuriating for everyone at first. you have this forum, you have the discord. more importantly you have a will of fire blazing inside you (you're gonna need it for the first two mods). you'll make it. and it's not forge's fault. usually. mojang changes things. they changed how guis (windows and controls) are drawn in 1.19 and 1.20. first you say "aaargh, no!". then, in one day, you'll say - "hey, this GuiGraphics system is actually so much nicer than what we had before! no longer do i need to magically know i need to call some static methods from some separate classes.". language files are unchanged. english goes to src\main\resources\assets\MODID\lang\en_us.json texture files are changed slightly. your pickaxe texture goes to src\main\resources\assets\MODID\textures\item\awesome_pickaxe.png similarly for blocks (block subdirectory under textures). if you had them in subdirectories, move them into two directories i said (block and item) and only those two. if you added something to texture atlases, now you use jsons to add to atlases.
  17. yep, nbt in item stack is fine. if a system worked "part of the time", trust me it would not exist for years. it's simply a storage format - a WAY to write data. it can not "not work" because it doesn't do anything magically on it's own.
  18. do not change creeper class. you need to change creeper entities at runtime. respond to "entity joins level" event. if the entity is a creeper, add your cat or whatever it is into goals of the creeper instance.
  19. outside of registration class, there should be no "string representations" or paths to your items and blocks (tags are okay). and what you used is for translation and displaying on screen. now during registration, did you make a BlockItem instance for the purpose of creative tab? if you did, do stack.getItem().equals(staticBlockItemFromRegistration) frankly, i'm not sure what you need to do so if the above row didn't help, please paste problematic method.
  20. first of all, there is a single instance of YourItem existing on the server while the game is running, and between zero and 123456789 item stack instances - in containers, in player inventories, in machine inventories... you see where i'm going with this. you can not say "private boolean flag" - if two players have stacks of that item, your logic will get mixed up. any information needs to be held withing ItemStack. yes it can be done but it isn't needed in your case. next, tick events fire every 1/20 of the second (some even twice per 1/20 of the second). should your code run that often? any of your code? because players can not detect game changes that quick. to execute every second, always start this event handler with " if level.whateverTotalGameTimeIsCalledNow % 20 == 15" to do your thing once per second (for some things even that is too often). ok, now you need to decide how the event will work. one way is to apply a two seconds of existing potion effect every two seconds and done. that's how most people do it because it's simple. and yes, when you apply potion effect you can specify to hide particles. other option is what you tries but you have to remember things on player or on ItemStack object; doable as well. next, getMainHandItem is ok until things start working, but after that, consider curios and other slots too. finally item comparison - i don't see where you compare the item to your item. to do that, either do itemStack.is(someItemTag) or itemStack.getItem.equals(MyItems.MyItem). or do instanceof in the previous thing if you expect subclasses.
  21. spawning is tricky business and there is now way to tell you instantly. you need to put log calls when your flier spawns and when it despawns (it's quite possibe that they despawn right away for some reason). print coordinates too of course and teleport there and see. oh and you're not in peaceful difficulty, of course.
  22. we told you what you need to do but you are not listening. 1) move to newer version if you expect help here. you won't getting any more. 2) follow the game logic, either through debugger, or just through IDE without the game. i don't hold minecraft code in my head and nobody else does. we simply can't answer this without looking how exactly a sapling grows. and if you don't care about your mod enough to figure it out, why should anyone else?
  23. https://forge.gemwire.uk/wiki/SimpleChannel https://forge.gemwire.uk/wiki/Sending_Packets
×
×
  • Create New...

Important Information

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