Commands NOT accepted right

Started by LueLusten on

Topic category: Help with MCreator software

Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Commands NOT accepted right

The command extract option is floored (1.7.4)

for one it creates the hole thing in one big string after cleaning it up it just errors out on a basic summens command

               if(true){
                    if(entity instanceof EntityPlayerMP){
                         MinecraftServer minecraftserver = FMLCommonHandler.instance().getMinecraftServerInstance();
                         if(minecraftserver!=null)
                              minecraftserver.getCommandManager().executeCommand((EntityPlayerMP)entity, "summon Villager ~1 ~ ~ {Profession:5,CustomName:\"Frank\",CustomNameVisible:1,Career:1,CareerLevel:42,CanPickUpLoot:0,PersistenceRequired:1,Invulnerable:1,Offers:{Recipes:[{buy:{id:\"wheat_seeds\",Count:1},maxUses:9999999,sell:{id:\"diamond\",Count:64},rewardExp:false},{buy:{id:\"stone\",Count:1},maxUses:9999999,sell:{id:\"stone\",Count:1},rewardExp:false}]}}");
                    }
               }

Why have a option to extract a command what MCreator can't handel

Last seen on 17:17, 10. Jan 2024
Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
First of all, it would be
Thu, 10/26/2017 - 16:47

First of all, it would be nice if you provide the actual error.
Furthermore, I recommend you rather spawn the entity and add your desired attributes to it directly by code. It has many positives. (Like being executed faster)

Last seen on 22:52, 27. Oct 2017
Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:First of all, it would be
Thu, 10/26/2017 - 17:54

@#1 Can you spawn a villager and update there store that way? if you can, can you provide a example please, There is no main error until it's in the game, the extract works in the chat but when using the command extract I just get can't spawn in read no error like it does when there is a symtex error.

I used to make server and game settings in command blocks with these very same commands and wanted to put them to use.

But if I can spawn it in and add the attributes I would love that but some clean examples would be needed.

Last seen on 17:17, 10. Jan 2024
Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Something like this could
Thu, 10/26/2017 - 18:46

Something like this could work:

EntityVillager entityvillager = new EntityVillager(world,1);
entityvillager.setLocationAndAngles(x,y,z, 0.0F, 0.0F);
entityvillager.setCustomNameTag("TESTIFICATE");
MerchantRecipeList list = new MerchantRecipeList();
ReflectionHelper.setPrivateValue(EntityVillager.class,entityvillager,list,"buyingList","field_70963_i");
EntityVillager.ITradeList trade = new ListEnchantedBookForEmeralds(){
 public void addMerchantRecipe(IMerchant merchant, MerchantRecipeList recipeList, Random random){
recipeList.add(new MerchantRecipe(new ItemStack(Items.WHEAT_SEEDS),ItemStack.EMPTY,new ItemStack(Items.DIAMOND,64),0,9999999));
}
};
trade.addMerchantRecipe(entityvillager, (MerchantRecipeList)(ReflectionHelper.getPrivateValue(EntityVillager.class,entityvillager,"buyingList","field_70963_i")), entityvillager.rand);
if(!world.isRemote){
world.spawnEntityInWorld(entityvillager);
}

Last seen on 17:49, 25. Mar 2021
Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:Something like this could
Thu, 10/26/2017 - 20:15

This comment can change everything! Lots of mods with custom trades coming! XD