Jump to content

Aropretim

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by Aropretim

  1. Current state of progress: I was trying to find another way to "copy" the container-property from the chest to the scripted block, but I didn't find a way to get access to these datas, except the getContainer()-function. I was also trying to have a look inside the IBlockScripted.class file to check if I were able to add a setContainer()-function myself, but I only found hexcode inside. That's so confusing to me... I tried the best myself. Maybe someone else has an idea. Edit: I've got a spontaneous suggestion. Instead of scripting chest for the content I could write a playerscript to put progress-dependent content into the chest and put a scripted block nearby to store some data. I didn't test it already but theoretically it should work. It would just explode the playerscript if you have hundrets of chests and want every chest to have individual content (weapons in a bakery chest makes as less sense as bread in a bank's safe). I'll post the code if I'll be successful.
  2. Same here. That's why I started scripting with CustomNPCs. That's much more powerful than using commands. The "NpcUseOpCommands"-option just enables these commands for NPCs, not for command blocks.
  3. Command to delete an npc: /noppes npc npcName delete. Yes, server side clones are stored in a subfolder of the world (.minecraft/saves/[yourWorld]/customnpcs/clones/). When you download the world, the clones are included.
  4. It seems the npc is too far away. I think it have to be within your render distance. Maybe the /noppes clone add and /noppes clone spawn commands could be a solution.
  5. I really like your idea. There are two different ways to "store" clones - server- and clientsided. The client-sided (located in .minecraft/customnpcs/clones/) can be used in every world, but I don't believe they're accessable by scripts. On the other hand the server-sided clones (located in .minecraft/saves/yourWorldName/customnpcs/clones/) are accessable by scripts, but you need to copy them to the folder every time a new world is generated. The NPCName.json files contains even the scripts of the NPCs. It could be possible to copy the clone-files automatically at generating a new world with a little self-written mod, including the clones you want to copy. Unfortunatly I have no notion about Java or modding Minecraft. I think, the best way to let these clones spawn, are player-bound scripts (that should be the .minecraft/saves/yourWorldName/customnpcs/scripts/player_scripts.json file). This file has to be copied everytime at world-generation, too (at best by the self-written mod). I hope, I could help you. Edit: Even if it wouldn't be necessary I highly recommend you to write a little mod to copy the clones and the playerscripts. Anyone could mess up his whole installation of your modpack simply by editing, overwriting or deleting the client-sided clones with the CustomNPCs-tools. To fix this he would have to reinstall the modpack. But if you store the clones in a mod and copy them every time a world is generating, he would only mess up one world, and not the whole modpack-installation. Maybe you can even implement a chat-command to overwrite the (messed up) clones with the default ones.
  6. It seems there is missing an option to instant build. But put some NPCs with the "Builder"-job nearby. It takes some time, but they will build the building for you.
  7. Try this Javascript example: var defaultSkin = "customnpcs:textures/entity/humanmale/mercenarysteve 2.png"; var attackSkin = "customnpcs:textures/entity/humanmale/magesteve.png"; function target(event) { event.npc.getDisplay().setSkinTexture(attackSkin); } function targetLost(event) { event.npc.getDisplay().setSkinTexture(defaultSkin); } Just replace the texture-paths with the two you want to use.
  8. I really like the scripting possibilities of this mod, but I'm missing something like a "Scripted Chest" or at least a "setContainer(int size)" method for the "Scripted Block". I was trying to script a workaround with a chest nearby, but I failed because of not knowing how to show the chest's GUI or to create a high dynamic dialog. function interact(event) { var container = event.block.world.getBlock(event.block.getX(), event.block.getY()-1, event.block.getZ()).getContainer(); var tempDialog = new IDialog(); // <-- This don't work - need something similar var dialogText = "Content:"; for (i=0; i<container.getSize(); i++) { if(container.getSlot(i) && container.getSlot(i).getName() != "minecraft:air") { dialogText += container.getSlot(i).getDisplayName() + " x" + container.getSlot(i).getStackSize(); } } tempDialog.setText(dialogText); // setting DialogOptions here to get some or all items event.player.showDialog(tempDialog); } The final idea behind this is to put player dependent content in chests. For example a Player who has finished Quest 1 can find a wooden sword, wood coins or leather armor in a chest, while another player, who has finished Quest 27 can find diamond equipment inside the same chest. Another reason for wanting a Scripted Chest is to want locked chests. I made a working (un)locking script for "Scripted Doors" and it would be really nice, if I could use a similar one for chests too. Has anyone a solution? Edit: It seems I think too complicated. Two simple lines like these... var containerBlock = event.target.getWorld().getBlock(event.target.getX(), event.target.getY()-1, event.target.getZ()); PlayerEvent.InteractEvent(event.player, event.type, containerBlock); ... should let me directly interact with the chest, isn't it? Unfortunatly neither PlayerEvent nor InteractEvent are defined. Has anyone another idea?
×
×
  • Create New...

Important Information

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