Jump to content

tal124

Members
  • Posts

    87
  • Joined

  • Last visited

Everything posted by tal124

  1. My Init Method is called in my main class, along with all of my other deferred registers. My issue isn't so much that I'm unable to spawn the slime (Im not able too) but that the game CTDs after about 20 seconds of creating a new world, and instantly upon trying to enter it again. I will try the entity renderer method tomorrow, and could you describe the methods of attaching the subscribing events? I've been working on this pretty much on my own, with very little guidance other than source code. So it would be very helpful
  2. I have created a custom entity called Chocolate Slime, The bug has occurred since I created it, and stops when I remove it, however I see no reason for the crash, but the crash log says a lot of things that I'm unsure of how it connects. Crash Log: ChocolateSlime.class: Registration of Class: Main Rendering & Attribute Creation: ChocolateSlimeRenderer.class:
  3. That worked, I didn't know there was a Keys option. Game no longer crashes
  4. All that I have added to the CoalTools class was ModSerializers.init() from the deferred registry from ModSerializers
  5. I have created a GlobalLootSerializer And a GlobalLootProvider (unsure of what to put in start other than add()) and I have registered my Serializer so its set up and ready But I am unsure as to how to actually go about adding in my custom drop when the tool is in hand. Or if there is an easier way to go about this addition within each ItemClass
  6. Nvm Shrink actually removed it, but how do I get the item that I added to automatically place into the EquipmentSlot of my choice?
  7. player.getEquipmentSlot() I retried stack.shrink(1), and it moved my item out of the equipment slot but didn't delete it so progress? maybe?
  8. I have tried stack.is(myItem(THE item I was replacing the OG with)), player.getItemBySlot(EquipmentSlot.HEAD).is(myItem(also to replace)) (this crashed the game), stack.is(myOGItem).shrink(1) (this also crashed the game), stack.hurtAndBreak(), couldn't figure out the consumer as I've only used them for my DataGens. And Nothing else I could think of that would openly remove an item from the players inventory, I've also tried setting the item as Items.AIR but that did nothing.
  9. I have created an ItemClass that uses OnArmorTick and am trying to do something similiar to this Which removes the Entity on the ground, and replaces it with the Item of my choice, however I want to do the same thing with the stack in the equipment slot that it is in I want to be able to remove the previous item (from 50% damage and lower) and while on fire, with my Fire Version of the item. Both sets of code I have in there work, I simply cannot find a way to remove the stack from their inventory.
  10. Its fixed, I created an Entity.removalReason for the Item and it removes the item before popping out the one Item asked for. The code up there is the current and working version of it. I may go through later and add && level.isClientSide() just for precautions
  11. I figured that out when I was working on my ArmorCustomItems, onEntityItemUpdate works fine for it, But now It pops 3 out at once when I drop them in some fire. I've gotten it fixed now, this will set the remove the item and spawn the other item that I'm trying to get. I basically discarded the CustomItemEntity because nothing I did with it would work. Once I found the ArmorTick I thought there might be an Entity modifier for it.
  12. Whenever I do try and register it, it won't let me This throws an error of "no instance(s) of type variable(s) exist so that EntityType<Entity> conforms to EntityType<CoalSwordEntity> inference variable I has incompatible bounds: equality constraints: EntityType<CoalSwordEntity> lower bounds: EntityType<Entity>
  13. I'm unsure how to actually register it since I can't actually register the ItemEntity as an Entity since that won't accept ItemEntities.
  14. How do I go about registering the EntityRenderer to the eventbus? I'm a bit stuck on that part as well.
  15. public class CoalSwordEntity extends ItemEntity { public CoalSwordEntity(EntityType<? extends ItemEntity> entityType, Level level) { super(entityType, level); } public CoalSwordEntity(Level level, double x, double y, double z, ItemStack stack) { super(level, x, y, z, stack); } public CoalSwordEntity(Level level, double x, double y, double z, ItemStack stack, double deltaX, double deltaY, double deltaZ) { super(level, x, y, z, stack, deltaX, deltaY, deltaZ); } } I have reverted to what I had originally to try and figure out what the issue was, It not even dropping the item at all, doing the same thing as before, I'm starting to believe my actual issue is somewhere in my ItemClass and not the ItemEntity class Somewhere around here? maybe?
  16. There were a few things I couldn't port over to the copied over code, So I went back to the extending, I'm not sure what code I'm putting in/not putting in thats messing with the ItemEntity and not allowing it to drop.
  17. I extended it originally, but when I added in the code needed, it still didn't function correctly, so I copied it. I will extend Entity instead and see how that pans out
  18. I have created a custom ItemEntity, however, no matter what's put into it (100% just vanilla code switched to be mine) Whenever I throw the item it doesn't drop it will pop out of my inventory for not even a millisecond and place back into the spot it was in.
  19. Item class, I couldn't seem to figure out the ItemEntity class and how to implement it so I tried my best with the item class itself The ItemEntity Class
  20. I'm looking through the Vanilla code, and I'm at a loss to what I should override to get my intended behavior, I originally used hurt, but it seems that may not workout as I can't return an item back to the fire that "killed" the item.
  21. I apologize, You said to put the actions in a custom ItemEntity class, I took this as making another separate class for these actions related to the tool I want to touch. And that I would need to make a separate one for each item. If this is not the case then do I simply make 1 ItemEntity class.
  22. So for clarification, I need to create 2 classes for each item I want to change, or 1 class that is the ItemEntity class, and a seperate one for each Item I want to change?
  23. I am trying to be able to throw a tool into a fire and have it return another tool without getting burnt in the fire, I am unsure how to go about this as I cannot think of another item that does something similar in vanilla to look at the code. What might be the best way to go about doing this? I know to create a class for the item, but am unsure how to remove the entity that is dropped and replace it.
×
×
  • Create New...

Important Information

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