
CBUltimate
Members-
Posts
46 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
One step closer.
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
CBUltimate's Achievements

Tree Puncher (2/8)
0
Reputation
-
[1.11] How to cancel all player events including moving?
CBUltimate replied to CBUltimate's topic in Modder Support
InputEvent.KeyInputEvent is not cancelable though, how should I cancel it? -
[1.11] How to cancel all player events including moving?
CBUltimate posted a topic in Modder Support
I can't find a played move event to cancel. Is there a way to cancel all player events or do I have to cancel each(block placed, break, item use.. etc) one by one? -
[1.11] How to add custom arrows for vanilla bow?
CBUltimate replied to CBUltimate's topic in Modder Support
I'm trying to make the Renderer for the custom arrow but it gets quite complicated with RenderManager. How do I just use Minecraft's Vanilla Arrow Renderer? RenderingRegistry.registerEntityRenderingHandler(EntityDullArrow.class, new RenderDullArrow()); // RenderDullArrow() requires RenderManager package mod.cbultimate.stranded.entity; import net.minecraft.client.renderer.entity.RenderArrow; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class RenderDullArrow extends RenderArrow<EntityDullArrow> { public static final ResourceLocation RES_ARROW = new ResourceLocation("textures/entity/projectiles/arrow.png"); public RenderDullArrow(RenderManager renderManagerIn) { super(renderManagerIn); } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(EntityDullArrow entity) { return RES_ARROW; } } -
[1.11] How to add custom arrows for vanilla bow?
CBUltimate replied to CBUltimate's topic in Modder Support
What should I put for IRenderFactory? -
[1.11] How to add custom arrows for vanilla bow?
CBUltimate replied to CBUltimate's topic in Modder Support
My arrow entity is a white box, how do I fix that? How do I use the resource location of vanilla Minecraft arrows? EntityRegistry.registerModEntity(new ResourceLocation(StrandedMod.MODID, "dull_arrow"), EntityDullArrow.class, "entity_dull_arrow", 1, StrandedMod.instance,16, 1, false); -
I am working on a command called /home for players to teleport home after 30 seconds of not moving, if player moves, intermission is canceled. How do I check if player moved to cancel the teleportation? My code so far. package mod.cbultimate.stranded.command;//Created by CBU on 23/1/2017. import net.minecraft.command.CommandBase; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.server.MinecraftServer; import java.util.Timer; import java.util.TimerTask; public class CommandHome extends CommandBase { private Timer timer = new Timer(); private TimerTask cooldown; private TimerTask intermission; @Override public String getCommandName() { return "home"; } @Override public String getCommandUsage(ICommandSender sender) { return "Return to your spawn location after 30 seconds. Moving may interupt the teleportation."; } @Override public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { intermission = new transmission(); timer.schedule(intermission, 5000); } private class transmission extends TimerTask{ @Override public void run() { System.out.println("Teleported."); } } }
-
[1.11] How to add custom arrows for vanilla bow?
CBUltimate replied to CBUltimate's topic in Modder Support
Is this what you mean? EntityRegistry.registerModEntity(new ResourceLocation(StrandedMod.MODID, "dull_arrow"), EntityDullArrow.class, "entity_dull_arrow", 1, "mod.cbultimate.stranded.StrandedMod",1, 1, false); -
[1.11] How to add custom arrows for vanilla bow?
CBUltimate replied to CBUltimate's topic in Modder Support
net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Stranded Mod (cbu_strandedmod) Caused by: java.lang.NullPointerException at net.minecraftforge.fml.common.registry.EntityRegistry.doModEntityRegistration(EntityRegistry.java:183) at net.minecraftforge.fml.common.registry.EntityRegistry.registerModEntity(EntityRegistry.java:149) at mod.cbultimate.stranded.item.ModItems.registerItems(ModItems.java:49) at mod.cbultimate.stranded.item.ModItems.preInit(ModItems.java:36) at mod.cbultimate.stranded.StrandedMod.preInit(StrandedMod.java:50) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:621) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:243) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:221) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:145) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:615) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:264) at net.minecraft.client.Minecraft.startGame(Minecraft.java:476) at net.minecraft.client.Minecraft.run(Minecraft.java:385) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) -
How do I register a command in 1.11?
-
[1.11] How to add custom arrows for vanilla bow?
CBUltimate replied to CBUltimate's topic in Modder Support
It crashes when I try to start it. EntityRegistry.registerModEntity(new ResourceLocation(StrandedMod.MODID, "dull_arrow"), EntityDullArrow.class, "entity_dull_arrow", 1, StrandedMod.class,1, 1, false); Where should I register the entity? I tried to register it in FMLPreInitializationEvent. -
[1.11] How to add custom arrows for vanilla bow?
CBUltimate replied to CBUltimate's topic in Modder Support
I came across this error, what should I do? "Don't know how to add class mod.cbultimate.stranded.entity.EntityDullArrow" package mod.cbultimate.stranded.entity;//Created by CBU on 22/1/2017. import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class EntityDullArrow extends EntityArrow { public EntityDullArrow(World worldIn) { super(worldIn); } public EntityDullArrow(World worldIn, double x, double y, double z) { super(worldIn, x, y, z); } public EntityDullArrow(World worldIn, EntityLivingBase shooter) { super(worldIn, shooter); } @Override protected ItemStack getArrowStack() { return null; } } package mod.cbultimate.stranded.item;//Created by CBU on 22/1/2017. import mod.cbultimate.stranded.entity.EntityDullArrow; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.projectile.EntityArrow; import net.minecraft.item.ItemArrow; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemDullArrow extends ItemArrow { @Override public EntityArrow createArrow(World worldIn, ItemStack stack, EntityLivingBase shooter) { EntityDullArrow entityDullArrow = new EntityDullArrow(worldIn, shooter); entityDullArrow.setDamage(1); entityDullArrow.setKnockbackStrength(0); entityDullArrow.pickupStatus = EntityArrow.PickupStatus.DISALLOWED; return entityDullArrow; } } [04:29:25] [server thread/ERROR]: "Silently" catching entity tracking error. net.minecraft.util.ReportedException: Adding entity to track at net.minecraft.entity.EntityTracker.addEntityToTracker(EntityTracker.java:259) [EntityTracker.class:?] at net.minecraft.entity.EntityTracker.trackEntity(EntityTracker.java:101) [EntityTracker.class:?] at net.minecraft.world.ServerWorldEventHandler.onEntityAdded(ServerWorldEventHandler.java:43) [serverWorldEventHandler.class:?] at net.minecraft.world.World.onEntityAdded(World.java:1304) [World.class:?] at net.minecraft.world.WorldServer.onEntityAdded(WorldServer.java:1179) [WorldServer.class:?] at net.minecraft.world.World.spawnEntityInWorld(World.java:1295) [World.class:?] at net.minecraft.world.WorldServer.spawnEntityInWorld(WorldServer.java:1125) [WorldServer.class:?] at net.minecraft.item.ItemBow.onPlayerStoppedUsing(ItemBow.java:143) [itemBow.class:?] at net.minecraft.item.ItemStack.onPlayerStoppedUsing(ItemStack.java:528) [itemStack.class:?] at net.minecraft.entity.EntityLivingBase.stopActiveHand(EntityLivingBase.java:2985) [EntityLivingBase.class:?] at net.minecraft.network.NetHandlerPlayServer.processPlayerDigging(NetHandlerPlayServer.java:626) [NetHandlerPlayServer.class:?] at net.minecraft.network.play.client.CPacketPlayerDigging.processPacket(CPacketPlayerDigging.java:56) [CPacketPlayerDigging.class:?] at net.minecraft.network.play.client.CPacketPlayerDigging.processPacket(CPacketPlayerDigging.java:12) [CPacketPlayerDigging.class:?] at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:15) [PacketThreadUtil$1.class:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_111] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_111] at net.minecraft.util.Util.runTask(Util.java:26) [util.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:753) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:698) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:156) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:547) [MinecraftServer.class:?] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_111] Caused by: java.lang.IllegalArgumentException: Don't know how to add class mod.cbultimate.stranded.entity.EntityDullArrow! at net.minecraft.entity.EntityTrackerEntry.createSpawnPacket(EntityTrackerEntry.java:670) ~[EntityTrackerEntry.class:?] at net.minecraft.entity.EntityTrackerEntry.updatePlayerEntity(EntityTrackerEntry.java:391) ~[EntityTrackerEntry.class:?] at net.minecraft.entity.EntityTrackerEntry.updatePlayerEntities(EntityTrackerEntry.java:501) ~[EntityTrackerEntry.class:?] at net.minecraft.entity.EntityTracker.addEntityToTracker(EntityTracker.java:233) ~[EntityTracker.class:?] ... 21 more -
[1.11] How to add custom arrows for vanilla bow?
CBUltimate replied to CBUltimate's topic in Modder Support
The custom arrows called Dull Arrows should be shot out. -
[1.11] How to add custom arrows for vanilla bow?
CBUltimate replied to CBUltimate's topic in Modder Support
But then the arrows shot out are normal arrow entities. How should I fix that? -
The vanilla bow checks for ItemArrow but how can I make the vanilla bow check for ItemDullArrow?
-
I need EntityPlayerMP for sending packets but event only provides EntityPlayer event.getEntityPlayer(). Thanks in advance.