Apply a status effect to an entity
curl --request POST \
--url http://localhost:3917/effect/apply \
--header 'Content-Type: application/json' \
--data '
{
"duration": 4,
"entity_id": 5,
"modifiers": [
"move_speed:multiply:0.5"
],
"source": 3,
"stack_policy": "stack:3",
"tag": "poison",
"tick_effect": "dps:10"
}
'import requests
url = "http://localhost:3917/effect/apply"
payload = {
"duration": 4,
"entity_id": 5,
"modifiers": ["move_speed:multiply:0.5"],
"source": 3,
"stack_policy": "stack:3",
"tag": "poison",
"tick_effect": "dps:10"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
duration: 4,
entity_id: 5,
modifiers: ['move_speed:multiply:0.5'],
source: 3,
stack_policy: 'stack:3',
tag: 'poison',
tick_effect: 'dps:10'
})
};
fetch('http://localhost:3917/effect/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3917",
CURLOPT_URL => "http://localhost:3917/effect/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'duration' => 4,
'entity_id' => 5,
'modifiers' => [
'move_speed:multiply:0.5'
],
'source' => 3,
'stack_policy' => 'stack:3',
'tag' => 'poison',
'tick_effect' => 'dps:10'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3917/effect/apply"
payload := strings.NewReader("{\n \"duration\": 4,\n \"entity_id\": 5,\n \"modifiers\": [\n \"move_speed:multiply:0.5\"\n ],\n \"source\": 3,\n \"stack_policy\": \"stack:3\",\n \"tag\": \"poison\",\n \"tick_effect\": \"dps:10\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3917/effect/apply")
.header("Content-Type", "application/json")
.body("{\n \"duration\": 4,\n \"entity_id\": 5,\n \"modifiers\": [\n \"move_speed:multiply:0.5\"\n ],\n \"source\": 3,\n \"stack_policy\": \"stack:3\",\n \"tag\": \"poison\",\n \"tick_effect\": \"dps:10\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3917/effect/apply")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"duration\": 4,\n \"entity_id\": 5,\n \"modifiers\": [\n \"move_speed:multiply:0.5\"\n ],\n \"source\": 3,\n \"stack_policy\": \"stack:3\",\n \"tag\": \"poison\",\n \"tick_effect\": \"dps:10\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Applied effect 'poison' to entity 5 for 4s",
"ok": true
}Status effects
Apply a status effect to an entity
POST
/
effect
/
apply
Apply a status effect to an entity
curl --request POST \
--url http://localhost:3917/effect/apply \
--header 'Content-Type: application/json' \
--data '
{
"duration": 4,
"entity_id": 5,
"modifiers": [
"move_speed:multiply:0.5"
],
"source": 3,
"stack_policy": "stack:3",
"tag": "poison",
"tick_effect": "dps:10"
}
'import requests
url = "http://localhost:3917/effect/apply"
payload = {
"duration": 4,
"entity_id": 5,
"modifiers": ["move_speed:multiply:0.5"],
"source": 3,
"stack_policy": "stack:3",
"tag": "poison",
"tick_effect": "dps:10"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
duration: 4,
entity_id: 5,
modifiers: ['move_speed:multiply:0.5'],
source: 3,
stack_policy: 'stack:3',
tag: 'poison',
tick_effect: 'dps:10'
})
};
fetch('http://localhost:3917/effect/apply', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3917",
CURLOPT_URL => "http://localhost:3917/effect/apply",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'duration' => 4,
'entity_id' => 5,
'modifiers' => [
'move_speed:multiply:0.5'
],
'source' => 3,
'stack_policy' => 'stack:3',
'tag' => 'poison',
'tick_effect' => 'dps:10'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:3917/effect/apply"
payload := strings.NewReader("{\n \"duration\": 4,\n \"entity_id\": 5,\n \"modifiers\": [\n \"move_speed:multiply:0.5\"\n ],\n \"source\": 3,\n \"stack_policy\": \"stack:3\",\n \"tag\": \"poison\",\n \"tick_effect\": \"dps:10\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:3917/effect/apply")
.header("Content-Type", "application/json")
.body("{\n \"duration\": 4,\n \"entity_id\": 5,\n \"modifiers\": [\n \"move_speed:multiply:0.5\"\n ],\n \"source\": 3,\n \"stack_policy\": \"stack:3\",\n \"tag\": \"poison\",\n \"tick_effect\": \"dps:10\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3917/effect/apply")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"duration\": 4,\n \"entity_id\": 5,\n \"modifiers\": [\n \"move_speed:multiply:0.5\"\n ],\n \"source\": 3,\n \"stack_policy\": \"stack:3\",\n \"tag\": \"poison\",\n \"tick_effect\": \"dps:10\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Applied effect 'poison' to entity 5 for 4s",
"ok": true
}Body
application/json
Apply a timed status effect: entity_id, tag, duration seconds (default 5). Optional modifiers are "stat:op:value" strings (op = set/add/multiply); stack_policy is replace or stack:N; tick_effect is dps:N, hps:N, or custom:name; source is the applying entity id.
The body is of type any.
Response
200 - application/json
Effect applied; ok is false with an error field if the entity is not found.
⌘I