Jump to content

[NoOneButNo]

Members
  • Posts

    89
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by [NoOneButNo]

  1. You are registering your entity types wrong. You don't initialize them via static intiializer. You use ObjectHolder (DeferredRegistry also works). Since you are OVERRIDING a vanilla entity, you match the object holder's string parameter with the desired minecraft id you want to override with.

  2. Before I will start commenting, I will share my words of wisdom: MCreator is NOT SUPPORTED in this forum.

     

    Well there are really people like this. They think that people will just flat hand type the code for them as if magic. Well sorry to disappoint you, this is the reality. We programmers basically spent a considerable portion of our time learning this and you... you just... oh never mind. I hate MCreator and you just made that hate stronger with your toxic attitude. Go back after you are done learning basic java.

  3. Its actually pretty simple. First of all, the constructor that you are modifying is the block's position and not its motion. If you want to be able to modify its gravity, you can either use world tick and get every entity and check if its your falling block and set its motion. Or you can implement a custom falling block and override its tick method.

  4. Learn java first. I really recommend you doing so as this is just elementary java basics. If I provide you the code, you are going to copy paste it anyways.

    Well whatever:

     

    @SubscribeEvent
    public void onTick(PlayerTickEvent e){
    	if(e.side == LogicalSide.CLIENT)
    		return; //Checks if its client-side and if it is, return
    
    	if(e.player == null)
    		return; //Just in case someone stupid enough to pass in a null player
    
    	PlayerEntity p = e.player;
    
    	int level = EnchantmentHelper.getEnchantmentLevel(INSERT_YOUR_ENCHANTMENT, p.getItemStackFromSlot(EquipmentSlotType.FEET));
    
    	//If level is greater than zero.
    	if(level > 0){
    		do whatever you want here.
    	}
    }

     

  5. No need for a custom boots, just check in the tick even if said player has enchantment. Then if he has, apply the effect. EnchantmentHelper#getEnchantmentLevel is what you want here.

    As for the ItemStack applying, just set the EnchantmentType to ARMOR_BOOTS or something like that.

    • Like 1
  6. 3 hours ago, DavidM said:

    It doesn't act similarly to other projectiles.

    While yes they do, the fact that they are fire-able from crossbows and code-wise uses raytrace means that they should be treated as such (imo). I imagined it as real life firework flying towards you and not calling it a projectile (Projectile definition: an object propelled through the air, especially one thrown as a weapon).

  7. Currently, if player deals no damage, LivingAttackEvent is not called. Therefore, LivingHurtEvent is also not called. This causes some issues such as enchantment x unable to apply its bonus damage (subscribed at LivingHurtEvent or LivingDamageEvent) but is not called. An example scenario would be a player having -8 damage but has enchantment x that gives +`12 damage. Now, since the game checks first if the player has actually positive damage, the +12 will never be applied since the +12 is only present in the LivingHurtEvent which is never called.

     

    Now, I suggest that LivingHurtEvent should modify the damage first before checking if the damage is actually positive to ensure that the damage calculation is done right.

×
×
  • Create New...

Important Information

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