Why Isn't my custom entity shooting fireballs? (Minecraft Bedrock Addon Making) - json

I'm fairly new in making addons for Minecraft Bedrock, and right now I'm trying to make an addon that adds the "Wildfire" mob from the Minecon votes. And I basically got everything right I got the model, the animations and the melee attack. But, for some reason the "Wildfire" won't shoot the "fireballs" I basically copied the code from the vanilla Minecraft entity Blaze code. I've searched everywhere but no luck since theres not much topics/q&a on Minecraft Bedrock. I have no idea why this won't work. Please help me, thanks in advance!
"mode_switcher": {
"minecraft:target_nearby_sensor": {
"inside_range": 2.0,
"outside_range": 3.0,
"must_see": true,
"on_inside_range": {
"event": "switch_to_melee",
"target": "self"
},
"on_outside_range": {
"event": "switch_to_ranged",
"target": "self"
}
}
},
"ranged_mode": {
"minecraft:behavior.ranged_attack": {
"priority": 3,
"burst_shots": 3,
"burst_interval": 0.3,
"charge_charged_trigger": 0.0,
"charge_shoot_trigger": 4.0,
"attack_interval_min": 3.0,
"attack_interval_max": 5.0,
"attack_radius": 16.0
},
"minecraft:shooter": {
"def": "minecraft_small_fireball"
}
},
"events": {
"minecraft:entity_spawned": {
"add": {
"component_groups": [
"mode_switcher"
]
}
},
"switch_to_melee": {
"remove": {
"component_groups": [
"ranged_mode"
]
},
"add": {
"component_groups": [
"melee_mode"
]
}
},
"switch_to_ranged": {
"remove": {
"component_groups": [
"melee_mode"
]
},
"add": {
"component_groups": [
"ranged_mode"
]
}
},
"minecraft:on_hurt_event": {
"add": {
"component_groups": [
"mode_switcher"
]
}
}
}
This is not all the code Its just the code that's related to it. Please tell me if you want all of the code.

I finally solved it. Well I guess not solve it because im still not to sure on what the problem was but, what I did was I used the code from the blaze in the Minecraft Beta version. That fixed it the only difference I found was that in the "ranged_mode" the "minecraft:shooter" component was before the "minecraft:behavior_ranged_attack".

You may have been mixing code from multiple format versions like I did before I realized that there was a difference. It could also be possible that you didn't make its attack range large enough, I also didn't see any code that selects a target for it to target. For any attacks to work you will need to make it select a target first. It look like you have only included code that allows it to swap attack types for a selected target. Keep this in mind when making behaviors in the future.

Related

Can't get custom configuration points working for my VS Code extension

So I've been spending a lot of time trying to get a couple specific settings working for my language extension in VS Code, and while the documentation and the few articles online seem to make it sound as simple as adding a "configuration" point in my package.json and a "getConfiguration()" call in the extension.ts file, it seems that there is more needed to get them working. This is my first extension I've made so I'm a bit unfamiliar with some of these things.
I am working on this project for work, so I will paste some of my code below with certain edits. The main issue I am getting right now is that it recognizes that I have added the configuration points to the package json, but I get this error when trying to debug the extension:
Cannot register '<configuration_name>'. This property is already registered
I have read as much as I can online about this and it seems that maybe the issue is that VS Code is seeing these settings as already defined and therefore is confused because it may be expecting custom configurations. I'm not sure. I feel though the issue must lie in my extension.ts file since when I look at the configuration example on the VS Code Examples repository on Github, they are doing quite a lot more than just the simple "getConfiguration()" function I am using. But I really have no idea what I would do. I am not very familiar with typescript as of yet, so any help would be greatly appreciated on this. Anyone have any insight as to why it would be doing this?
Here is my package.json:
{
"name": "ex-lang",
"displayName": "Example",
"description": "Example language support",
"version": "0.0.1",
"engines": {
"vscode": "^1.64.2"
},
"categories": [
"Programming Languages",
"Snippets"
],
"contributes": {
"languages": [
{
"id": "ex",
"aliases": [
"EX",
"ex",
"Example"
],
"extensions": [
".ex"
],
"configuration": "./language-configuration.json",
"icon": {
"light": "./icons/icon.png",
"dark": "./icons/icon.png"
}
}
],
"grammars": [
{
"language": "ex",
"scopeName": "source.ex",
"path": "./syntaxes/ex.tmLanguage.json"
}
],
"snippets": [
{
"language": "ex",
"path": "./snippets.json"
}
],
"configuration": [
{
"id": "ex-config",
"title": "Example Custom Settings",
"properties": {
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment.block.documentation.ex"
],
"settings": {
"foreground": "#efc752"
}
}
]
},
"editor.bracketPairColorization.enabled": true,
"workbench.colorCustomizations": {
"editorBracketHighlight.foreground1": "#2b85d5",
"editorBracketHighlight.foreground2": "#559ddd",
"editorBracketHighlight.foreground3": "#80b6e6",
"editorBracketHighlight.foreground4": "#aaceee",
"editorBracketHighlight.foreground5": "#d5e7f7",
"editorBracketHighlight.foreground6": "#c6cad4",
"editorBracketHighlight.unexpectedBracket.foreground": "#db6165"
}
}
}
]
},
"dependencies": {
"vsce": "^2.9.2"
},
"devDependencies": {
"#types/node": "^16.11.7",
"#types/vscode": "^1.40.0",
"#typescript-eslint/eslint-plugin": "^5.19.0",
"#typescript-eslint/parser": "^5.19.0",
"eslint": "^8.13.0",
"typescript": "^4.7.2"
}
}
I have tried messing a bit with Activation Events, but I was getting more issues with it as I suppose I don't understand them as well as I might like. I have also fiddled with different scopes for the configuration points and such but to no avail. And lastly, I did have a "main" contribution point, but I was having very strange pathing issues when I had it (it kept saying the file was not found), so I removed it. Not sure if any of these things are also contributing to my problem or not.
Here is my extension.ts file for reference:
import * as vscode from 'vscode';
export function activate(context: vscode.ExtensionContext) {
vscode.workspace.getConfiguration('ex-config');
}

Fiware Orion NGSI-LD : Support of LanguageMap

I would like to know weither the LanguageMap functionnality is supported (or will be supported) in the Orion-LD implementation.
The languageMap is presented on the folowing video : https://www.youtube.com/watch?v=ll-t8Vi9i50
The idea is to be able to request an attribute in a specific language. Exemple with the following JSON :
"pitch": {
"type": "Property",
"value": [
{
"language ": "fr",
"article": "Mariage"
},
{
"language": "en",
"article": "Wedding"
},
{
"language": "ru",
"article": "Выставка!"
},
{
"language": "zh",
"article": "展览"
},
{
"language": "ja",
"article": "展覧会"
}
]
},
How to query a specific language article?
Many thanks in advance for your feedback.
Rgds
LC
Yes, it will most definitely be supported.
Not the very first item on our Backlog, but yeah, it's quite prioritized. Third item in a list of hundreds of items ... (right now - the list is somewhat volatile).
It will not be exactly as in your example, please check the latest published ETSI NGSI-LD spec to get it right. It's something like this:
"pitch": {
"type": "LanguageProperty",
"languageMap": {
"en": "marriage",
"fr": "mariage",
"es": "matrimonio",
...
}
}
If you create an issue on Orion-LD's github, you will be informed as soon as the work begins on this, and I can even send a hint every now and then, before the work actually begins. Hopefully, work will commence on this interesting feature before summer, but I can't really promise anything.
About queries, if I remember correctly, the query will be done simply with
?q=pitch==matrimonio&lang=es
(please check the API spec to verify what I just said)

Json to Data Frame and Excel with Python

I would like to ask for some help with the conversion of a nested json into pandas df.
I have read the quite brilliant input from a couple of year past, but that is outdated now. :(
Flatten double nested JSON
So here is a sample of my input data (mind that classes might contain up to 10 class name and confidence pairs):
[
{
"classifier_id": "my_classifier_id",
"url": "https://api.eu-de.natural-language-classifier...",
"text": "for sales? aligning obsolete incentive\u00a0 system to what is the standard today: 100% reference salary, 100% of ref sal if you hit 100% of your quota",
"top_class": "conditions",
"classes": [
{
"class_name": "conditions",
"confidence": 0.9074866214536228
},
{
"class_name": "temperature",
"confidence": 0.09251337854637723
}
]
},
{
"classifier_id": "my_classifier_id",
"url": "https://api.eu-de.natural-language-classifier...",
"text": "Complete integration of incentives.\u00a0 People act inline with how they are compensated as the general rule. \u00a0 If we get that right then this model can genuinely change the face of IBM to the client.",
"top_class": "conditions",
"classes": [
{
"class_name": "conditions",
"confidence": 0.9683663322166756
},
{
"class_name": "temperature",
"confidence": 0.0316336677833244
}
]
},
{
"classifier_id": "my_classifier_id",
"url": "https://api.eu-de.natural-language-classifier.watson...",
"text": "Enablement, operational support on the most basic things",
"top_class": "temperature",
"classes": [
{
"class_name": "temperature",
"confidence": 0.8174158442711534
},
{
"class_name": "conditions",
"confidence": 0.1825841557288465
}
]
}
]
What I have tried thus far in python:
data_df = pd.read_json(r'C:\Users\...\Documents\Python NLP\WATSON NLC\OUTPUT JSON\nlc_data_full.json')
When using this the classes still remain in a json like form:
[{'class_name': 'conditions', 'confidence': 0.907486621453622}, {'class_name': 'temperature', 'confidence': 0.092513378546377}]
[{'class_name': 'conditions', 'confidence': 0.9683663322166751}, {'class_name': 'temperature', 'confidence': 0.031633667783324}]
[{'class_name': 'temperature', 'confidence': 0.8174158442711531}, {'class_name': 'conditions', 'confidence': 0.182584155728846}]
I would love to get a format that can be worked on in excel. Thank you for looking into this.
Well I think I managed to figure out what everyone already knew anyways. LOL
So the magic is in the pd.json_normalize function. With the parameters it takes it basically is able to open multinested json files with relative ease.
Also the pandas site has been a good friend as always: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.json_normalize.html
I am calling my dataset: nlc_data = [ .......
Here is a super lightweight solution for cases that do not have such intricate nesting: normie_2 = pd.json_normalize(nlc_data, max_level=0)
This one works for multi nested json files:
result = pd.json_normalize(nlc_data, 'classes', ['text', 'top_class'])
Well I guess I got a lot smarter today. Bare with me ... I just might have another awesome questions tomorrow.
Bye, Levi

How to find the elicit slot id for a dialog delegate

I'm new to Alexa development using ask cli, and I ran into a problem when I was going through the dialog-delegate-starter. In the json model, there is a field called elicitation, and it has the value "Elicit.Slot.251925459829.983270759031", which seems to be some sort of auto generated id. I'm imagining creating my own dialog intents, and having to fill this out manually. How is this id generated, and where does one find it?
"dialog": {
"intents": [
{
"name": "factIntent",
"confirmationRequired": false,
"slots": [
{
"name": "city",
"type": "cityName",
"elicitationRequired": true,
"confirmationRequired": false,
"prompts": {
"elicitation": "Elicit.Slot.251925459829.983270759031"
}
}
]
}
]
},
You don't really need to fill those in manually. Even if you use "manual delegation" you'll have those available. I'm not sure what you need them for, but there's a way to get them.
Maybe this will help: https://developer.amazon.com/es-mx/docs/custom-skills/delegate-dialog-to-alexa.html

Using Oracle UCM JSON data in fullcalendar?

Is there a way to fetch data from Oracle UCM's JSON option and use this in Full Calendar. I createed a service to return data from calendar data in UCM, and want to display the events using fullcalendar.
Here is an example feed that I get back:
"ResultSets": {
{
"SQLLMCal": {
"fields": [
{ "name": "SINGLE_ELEMENT" },
{ "name": "Start" },
{ "name": "SCHOOL_TYPE" },
{ "name": "SCHOOL_TYPE_ID" },
{ "name": "Title" },
{ "name": "ENTRY_SIDE_GROUP" }
],
"rows": [
[
"141",
"3/17/11 12:00 AM",
"Elementary",
"3",
"Big Burger",
"1"
]
]
}
}
}
Thanks, Ken
need to parse your own data using a custom events function:
http://arshaw.com/fullcalendar/docs/event_data/events_function/
Okay, great example of "problem exists between keyboard and chair"! I just had to stare at the documentation and the answer was right there.
In my code, I have the following:
events: function(callback) {
By definition, this MUST be
events: function(start, end, callback) {
Once I added the start and end parameters, everything worked perfectly.
Thank you Adam for pointing me the the right direction!
Ken