Jump to content

poopoodice

Members
  • Posts

    1160
  • Joined

  • Days Won

    7

Everything posted by poopoodice

  1. It should be working, have you update to the latest mapping?
  2. Thanks for the reply. This model works back in 1.15, and I've compared it with bow's item model but can't really figure out anything. Item model: { "parent": "item/generated", "textures": { "layer0": "planttech2:items/test_item" }, "overrides": [ { "predicate": { "test": 0 }, "model": "planttech2:item/test_item_0" }, { "predicate": { "test": 1 }, "model": "planttech2:item/test_item_1" }, { "predicate": { "test": 2 }, "model": "planttech2:item/test_item_2" }, { "predicate": { "test": 3 }, "model": "planttech2:item/test_item_3" }, { "predicate": { "test": 4 }, "model": "planttech2:item/test_item_4" } ] }
  3. Hello, I have a few questions about Item Property Override in 1.16: 1. Where is the correct place to call ItemModelsProperties.func_239418_a_() for adding overrides? Since calling it in Item's static initializer or constructor did not work, I managed to put it in client setup (which worked), but is it the right place? 2. It is not used by Minecraft. I used ItemModelsProperties.func_239417_a_(this, new ResourceLocation(MODID, "test_property")).call(stack, null, null) in my Item class and found it is working fine. But it never gets called by Minecraft. Code: private void doClientStuff(final FMLClientSetupEvent event) { ItemModelsProperties.func_239418_a_( ModItems.TEST_ITEM, new ResourceLocation(MODID, "test_property"), (stack, world, entity) -> { System.out.println("get property"); return entity == null || !(stack.getItem() instanceof TestItem) ? 0.0F : (entity.ticksExisted % 4) + 1; } ); } Thanks.
  4. In the debug screen do you see your block has the facing property, and does it change every time you place it with different direction? If yes, have you rotate its models according to its state in your blockstate file?
  5. in ItemTooltipEvent flags tells you whether "advanced tooltip" is enabled (f3 + h or something), normally if it's true it will render its registry name as well such as testmod:testitem itemStack the itemstack in the chosen slot is being rendered toolTip a list of existing tooltips from Item.addInformation() If you want to add information on it just add the desire element to the list get from event.getToolTip() I'm not sure about how to get the text from the language file but you can use TranslationTextComponent
  6. This is your model, but its rotations, translations and other actual rendering stuff are managed in your renderer.
  7. If you look at the usages of getCollisionBox() it is called from getEmptyCollisionShapes() -> getAllowedMovement() -> move() You need to call that yourself.
  8. I'm pretty sure he fixed that problem. The problem now is he's getting the cap using player.getCapability(...).orElse(null); And tries to assign value to null. That's also why I asked him if he registered his capability.
  9. Have you register your capability?
  10. So LivingEvent.LivingJumpEvent triggers when a LivingEntity jumps, that includes Zombies, Rabbits... entities like that. The problem is they don't have the capability since you only attach the capability to the players. Either attach to all living entities or check if the entity is player in LivingJumpEvent.
  11. Post updated code, and "where" do you think it went wrong. Edit: nvm, slow internet speed lol
  12. If you are checking your own entity: check doBlockCollisions in Entity, if you are checking your own block, override onEntityCollision (its bb cannot be a full cube). Otherwise check it manually as Dzuchun mentioned above using LivingTickEvent (I don't think there's a event for collision) and do checkings like how doBlockCollisions in Entity does.
  13. firstly: @Override public boolean shouldRender(DiamoniteEntity livingEntityIn, ClippingHelperImpl camera, double camX, double camY, double camZ) { return false; } secondly, you don't have any "render" method @Override public void render(...) but isn't your entity bsaed on the ItemEntity? See how ItemRenderer does it.
  14. You've already attach the capability to all players (don't worry about who's going to be attached, it knows who's the saved data's owner). You can also use player.getCapability(PlayerData.INSTANCE).orElseThrow(...) instead of ifPresent since every player should have one.
  15. It's fine to modify the variables in your entity class, but it seems like you forgot to save them. You shouldn't have variables saved in your ClientKeyEvents. I will say use capabilities to save it, and instead of using RenderHandEvent, use ClientTickEvent.
  16. If you look into vanilla slabs, slab has one property (ignores water logged boolean property), and 3 possible types: top, bottom, and double which represents theirs states, but I think you should be able to use vanilla slab class instead of creating your own one.
  17. I'm not sure if you need to create one, but it won't be hard since you said your entity is just another version of ItemEntity (just look into renderer/entity/ItemRenderer). and use RenderingRegistry.registerEntityRenderingHandler(entitytype, rendererf) to register your renderer
  18. The reason I said it is because I don't see you registering your renderer anywhere.
  19. If so then getting player from Minecraft is fine. But as I said it does not exist on server, you will need to use DistExecutor to achieve your target. Forge doc contains all information about it.
  20. Sorry for the confusions. For my question, to be more specific I'm trying to check if an item is fit with a certain vanilla item(like modded glass pane/glass pane, modded iron ingots/iron ingots), if it is, it allows players to use modded items to craft rather than using vanilla ones. The problem here is, the recipe I have has lots of items unlike fluid tanks and stuff like that that knows what are they taking. Will I need to mark their tags manually like you've mentioned above? Thanks for the reply.
  21. Is it possible to compare two items automatically? For example I have this: unknownItem.getTags().equals(vanillaItem.getTags()) but it obviously won't work if the unknownItem does not have same tag labelled as vanilla item. Are there any other ways besides hard coding what items tags will be there to be compared?
  22. What Draco means is the place you are registering entity renderers(StaticClientEventHandler) is client only, but you are calling it on both sides. Use DistExecutor You can't. However you can get the sender from the context. The problems you are facing are similar: have a look at this. Also if you look into ClientPlayerEntity, it has an annotation on it @OnlyIn(Dist.CLIENT) just like what you have at https://github.com/InterdimensionalCat/McAndAGun/blob/master/src/main/java/com/benthom123/mcandguns/client/StaticClientEventHandler.java#L20 https://mcforge.readthedocs.io/en/latest/concepts/sides/#fmlenvironmentdist-and-onlyin btw you don't have to implement a runnable interface, just use lambda instead
  23. 1.12 is no longer supported
×
×
  • Create New...

Important Information

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