Jump to content

vemerion

Members
  • Posts

    390
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by vemerion

  1. No problem, glad I could help!
  2. No problem! If you decide to go with the event solution, you can get the item like so: (which should work regardless of stack size) @SubscribeEvent public static void onFoodEaten(LivingEntityUseItemEvent.Finish event) { if (event.getItem().getItem() == RegistryHandler.GOLDEN_CHORUS_FRUIT.get()) { // Do what you want here } } if you go with the override route, you would do something like this: public class MyItem extends Item { public MyItem(Properties properties) { super(properties); } @Override public ItemStack onItemUseFinish(ItemStack stack, World worldIn, LivingEntity entityLiving) { // Do what you want here return entityLiving.onFoodEaten(worldIn, stack); } }
  3. You can get the ItemStack used directly from the event with the getItem() method. However, since it is your own custom item, you can alternatively override the onItemUseFinish method in the item class and avoid using an event altogether.
  4. Is it your own custom food item? If so, you can override the different methods in the item class (such as onItemUseFinish) to implement your functionality. Otherwise, you can subscribe to one of the subclasses of LivingEntityUseItemEvent, and check if the item being used is the specific one you want.
  5. You are absolutely right, you have to register a renderer for your snowball. If I am not mistaken it is the SpriteRenderer you should use.
  6. Minecraft does it by creating a FallingBlockEntity. You should be able to do a 'falling upwards' block by extending FallingBlockEntity and set the motion upwards instead of downwards.
  7. You are overriding getItem() and returning null, which is a problem, since it is getItem() that determines the texture of the projectile. I don't think you need to override that method at all, since the definition in the superclass should be fine.
  8. How have you implemented the attacking? Because if you are using the MeleeAttackGoal, I believe it sets the swingProgress variable, which you can then use to rotate the arm of the entity.
  9. Seems to me like you are never initializing your array, and thus it is null.
  10. No problem, glad I could help!
  11. The easiest way would probably be to make your own class that extends HeldItemLayer and add translation and scaling before rendering the item.
  12. Try adding a HeldItemLayer to your mob renderer.
  13. You really shouldn't copy all the attributes and method from a superclass into a subclass, because you already get those by inheritance. As far as boat speed is concerned, I think setMotion is the way to go, as with all entities.
  14. I see nothing wrong with your crafting recipe json file, I think the problem lies elsewhere. Where is the json file located?
  15. You should user the debug mode of your IDE together with breakpoints to figure out what is null. Also why have you annotated your entity classes with EventBusSubscriber?
  16. You could perhaps listen to the PotionRemoveEvent and check for a specific effect, and then cancel the event.
  17. vemerion

    -

    Hi! I have found Tabula to be tremendously helpful when creating custom models for entities. Blockbench is another alternative, which is also a pretty great tool.
  18. Well, the easy way to fix this is to return true from canPlayerBreakBlockWhileHolding. Of course that means that the grass will be destroyed while holding the gun instead...
  19. You would have to detect the jumping with for example a KeyInputEvent, and then send a packet to the server to inform the server that it should perform a jump action on a player. EDIT: Turns out there is a better way to do this, see diesieben's answer above.
  20. No problem, glad I could help! Slowing down the speed of the climb is easy, just change the y value in setMotion from 0.2 to something lower. As for requiring the player to look at the wall, that might be a bit harder, but should be doable with something like a RayTrace.
  21. You could try using a PlayerTickEvent like this: @SubscribeEvent public static void onPlayerTickEvent(PlayerTickEvent event) { if (event.phase == Phase.START && event.player.collidedHorizontally) { Vec3d motion = event.player.getMotion(); event.player.setMotion(motion.getX(), 0.2, motion.getZ()); } }
  22. Hello! I think your best bet is to create a new feature which places your own vine block. As you noted yourself, the already existing VinesFeature is a good place to check to learn how to make your own feature.
  23. I think a good place to start is looking at how vanilla Minecraft does it. Look at the classes TNTBlock and TNTEntity to get an idea of how you could go about making your own custom TNT blocks.
  24. You should add a call to super.tick() in your tick method (or at least a call to this.move()).
  25. If it is unchanged from 1.15, then you can specify the childBodyScale in the constructor of AgeableModel.
×
×
  • Create New...

Important Information

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