Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

SciPunk

Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by SciPunk

  1. I'm trying to get the motion of a Minecraft cape and replicate it to my custom elytra, where can I find the code?
  2. How can I create my own ArmPose, I want to change the ArmPose when ElytraFlying is triggered
  3. My projectile item, I want it to spin when in the air and stuck to surface, but I don't know how
  4. I have my throwable item, which I want it to spin when it is in the air and stick to the surface when it hits a block but I can´t figure out, my item uses a sprite renderer, here´s my code Item class Entity class ClientProxy class (where it renders)
  5. Thanks a lot, so for this case I should render it on the server-side? as I want other players to see the smoke
  6. Unfortunately haven't found one yet, I use Tabula currently and edit it to work in 1.15
  7. Hi, I'm trying to make a smoke bomb, here's my code but the particles doesn't seem to render My code: public class EntitySmokePellet extends ProjectileItemEntity { public static final EntityType<EntitySmokePellet> BATARANG = register(); protected EntitySmokePellet(EntityType<? extends ThrowableEntity> type, World worldIn) { super(EntitiesHolder.SMOKE_PELLET,worldIn); } @Override public IPacket<?> createSpawnPacket() { return NetworkHooks.getEntitySpawningPacket(this); } protected EntitySmokePellet(double x, double y, double z, World worldIn) { super(EntitiesHolder.SMOKE_PELLET, x, y, z, worldIn); } protected EntitySmokePellet(EntityType<? extends ThrowableEntity> type, LivingEntity livingEntityIn, World worldIn) { super(EntitiesHolder.SMOKE_PELLET, livingEntityIn, worldIn); } protected Item getDefaultItem() { return ItemHolder.SMOKE_PELLETE; } @Override protected void onImpact(RayTraceResult result) { if (!this.world.isRemote) { if (result instanceof EntityRayTraceResult) { EntityRayTraceResult entityRayTraceResult = (EntityRayTraceResult) result; if(entityRayTraceResult.getEntity() instanceof MobEntity) { MobEntity entity = (MobEntity) entityRayTraceResult.getEntity(); double d0 = (double)entity.getPosX() + 0.5D; double d1 = (double)entity.getPosY(); double d2 = (double)entity.getPosZ() + 0.5D; entity.addPotionEffect(new EffectInstance(Effects.SLOWNESS,120,5)); entity.addPotionEffect(new EffectInstance(Effects.NAUSEA,120,5)); entity.addPotionEffect(new EffectInstance(Effects.BLINDNESS,120,5)); entity.world.addParticle(ParticleTypes.LARGE_SMOKE,d0,d1,d2,0,0,0); this.remove(); } } else if (result instanceof BlockRayTraceResult) { BlockRayTraceResult blockRayTraceResult = (BlockRayTraceResult) result; for (int i = 0; i <= 25; i++) { this.world.addParticle(ParticleTypes.LARGE_SMOKE,blockRayTraceResult.getPos().getX() , blockRayTraceResult.getPos().getY() , blockRayTraceResult.getPos().getZ(), 0, 0,0); } this.remove(); } } } public static EntityType register() { return EntityType.Builder.<EntitySmokePellet>create(EntitySmokePellet::new, EntityClassification.MISC).size(0.8F, 0.8F).build("smoke_pellet").setRegistryName(ComicUniverse.MODID,"smoke_pellet"); } }
  8. The one that I found that was the most useful was tabula for 1.12, some little changes in the code but not drastically like Workbench
  9. Made a custom projectile, with it's own renderer but the when I right click to throw the projectile it spawns a... pig instead of my custom texture lol Item class Entity class Entity Renderer
  10. Got it, thanks! no, it was just for testing purposes now I got to figure out the "catch" also I noticed that with this code if I get hit by 2 arrows consecutively it crashes: @SubscribeEvent public static void onProjectileHitEvent(ProjectileImpactEvent event) { if (event.getRayTraceResult() instanceof EntityRayTraceResult) { EntityRayTraceResult entityRayTraceResult = (EntityRayTraceResult) event.getRayTraceResult(); if (entityRayTraceResult.getEntity() instanceof PlayerEntity) { PlayerEntity playerEntity = (PlayerEntity) entityRayTraceResult.getEntity(); if (playerEntity.getItemStackFromSlot(EquipmentSlotType.CHEST).getItem() == ItemHolder.BATMAN_CHEST) { event.setCanceled(true); } } } }
  11. Hi, thanks for the tip, tried to implement it to my code but I just can't seem to get it to work, tried to do it without the condition of the player looking at it for testing purposes and I just couldn't make it work, do you have any idea why? Here's my code: @SubscribeEvent public static void onProjectileHitEvent(ProjectileImpactEvent event) { EntityRayTraceResult entityRayTraceResult = new EntityRayTraceResult(event.getEntity(), event.getRayTraceResult().getHitVec()); Entity entity = entityRayTraceResult.getEntity(); if (entity instanceof PlayerEntity) { PlayerEntity playerEntity = (PlayerEntity) entity; if (playerEntity.getItemStackFromSlot(EquipmentSlotType.CHEST).getItem() == ItemHolder.BATMAN_CHEST) { event.setCanceled(true); } } }
  12. How could I make behavior on the player that when the player sees the projectile "catches it" e.g a skeleton shoots the player but if the player is facing the arrow the player catches the projectile so far the event I think it has to do something with it is ProjectileImpactEvent, however, I'm not entirely sure how could I write that behavior. Here's my code @SubscribeEvent public static void onProjectileCatchEvent(ProjectileImpactEvent event) { if (event.getEntity() instanceof ArrowEntity) { event.setCanceled(true); } }
  13. No worries thanks anyways, gonna check the debugger, I don't know why I didn't do that in the first place lol
  14. Bump, does anybody understand how flags work? or how can I edit the "Pose" of the flag?
  15. Thanks! but how could I register I'm kinda confused I implemented the interface and the methods but I'm not entirely sure how can I register the recipes, and how can I use them for my custom container(crafting table) this is my code public class SuitsRecipes implements IRecipeSerializer { public SuitsRecipes() { } @Override public IRecipe<?> read(ResourceLocation recipeId, JsonObject json) { return null; } @Nullable @Override public IRecipe<?> read(ResourceLocation recipeId, PacketBuffer buffer) { return null; } @Override public void write(PacketBuffer buffer, IRecipe recipe) { } @Override public Object setRegistryName(ResourceLocation name) { return null; } @Nullable @Override public ResourceLocation getRegistryName() { return null; } @Override public Class getRegistryType() { return null; } }
  16. I'm trying to make my own custom recipes for a custom container and I read in the docs that I needed to create a class
  17. Bump, I think it might be something to do with flags/pose but I'm not entirely sure what's making those small arms appear
  18. 1.7.10 is no longer supported in this forum please update to 1.14-1.15
  19. 1.- You have to register the event in a class like this public class YourEventClassEventHandler { @SubscribeEvent public static void negateFallDamage(LivingFallEvent event) { if (event.getEntityLiving() instanceof PlayerEntity) { PlayerEntity playerEntity = (PlayerEntity) event.getEntityLiving(); if (playerEntity.getItemStackFromSlot(EquipmentSlotType.CHEST).getItem() == ItemHolder.BATMAN_CHEST) { event.setCanceled(true); } } } @SubscribeEvent public static void onRenderPlayerPre(RenderPlayerEvent.Pre event) { PlayerEntity player = (PlayerEntity) event.getEntity(); if (player.isElytraFlying() && player.getItemStackFromSlot(EquipmentSlotType.CHEST).getItem() == ItemHolder.BATMAN_CHEST) { event.getRenderer().getEntityModel().bipedRightArm.showModel = false; event.getRenderer().getEntityModel().bipedRightArmwear.showModel = true; //70 varillas 45 de cemento event.getRenderer().getEntityModel().bipedLeftArm.showModel = false; event.getRenderer().getEntityModel().bipedLeftArmwear.showModel = true; event.getRenderer().getEntityModel().bipedBody.showModel = false; } } @SubscribeEvent public static void onRenderPlayerPost(RenderPlayerEvent.Post event) { PlayerEntity player = event.getPlayer(); } } as you can see the onRenderPlayerPre method handles the render of the player, there you can get the model and hide the body parts you want, then you can register the events in the constructor of your mod like this: MinecraftForge.EVENT_BUS.register(YourEventClassHandler.class);
  20. Managed to change the player model for my custom elytra, however whenever I toggle the " Elytra Fly" some weird small arms appear even though I set their visibility to false, this is my code: @SubscribeEvent public static void onRenderPlayerPre(RenderPlayerEvent.Pre event) { PlayerEntity player = (PlayerEntity) event.getEntity(); if (player.isElytraFlying() && player.getItemStackFromSlot(EquipmentSlotType.CHEST).getItem() == ItemHolder.BATMAN_CHEST) { event.getRenderer().getEntityModel().bipedRightArm.showModel = false; event.getRenderer().getEntityModel().bipedRightArmwear.showModel = false; event.getRenderer().getEntityModel().bipedLeftArm.showModel = false; event.getRenderer().getEntityModel().bipedLeftArmwear.showModel = false; event.getRenderer().getEntityModel().bipedBody.showModel = false; } } The weird arms I got:
  21. Thanks anyway, gonna start a topic with this one to see if I can get help
  22. Managed to change the player model thanks, however whenever I toggle the " Elytra Fly" some weird small arms appear even though I set their visibility to false, this is my code: @SubscribeEvent public static void onRenderPlayerPre(RenderPlayerEvent.Pre event) { PlayerEntity player = (PlayerEntity) event.getEntity(); if (player.isElytraFlying() && player.getItemStackFromSlot(EquipmentSlotType.CHEST).getItem() == ItemHolder.BATMAN_CHEST) { event.getRenderer().getEntityModel().bipedRightArm.showModel = false; event.getRenderer().getEntityModel().bipedRightArmwear.showModel = false; event.getRenderer().getEntityModel().bipedLeftArm.showModel = false; event.getRenderer().getEntityModel().bipedLeftArmwear.showModel = false; event.getRenderer().getEntityModel().bipedBody.showModel = false; } } The weird arms I got: The
  23. Hi I'd like to know if you guys have any good course / book to know how OpenGL works for Minecraft
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.