#help-archived
1 messages · Page 95 of 1
recipe.setIngredient('d', enchantedDiamond);
Cannot resolve method setIngredient(char, ItemStack) or smth like that
it needs to be a material
Oof
Lemme jump on pc
Either that or RecipeChoice
wat dat
i'm new to this
how would i go about utilising that
this is my first like custom recipe lol
should i like cast the itemstack to that?
use MaterialData then ig
public static final CustomEntityType<DummyZombie> DUMMY_ZOMBIE = new CustomEntityType<DummyZombie>("dummy_zombie", DummyZombie.class, EntityTypes.ZOMBIE, DummyZombie::new);
@jaunty night I mean perhaps add the id param here
I don't see it atleast
Ah, so replace dummy_zombie with just zombie
new MaterialData(enchantedDiamond.getType(), enchantedDiamond.getData().getData())
deprecated
lovely
time to try it!
lmao
They completely phased out number ids though
ShapedRecipe#setIngredient(key, new MaterialData(Material.DIRT, data))
I have no idea
XD
wait nvm
occy perhaps trying to get the data from another stack?
ItemStack item = new ItemStack(Material.DIRT);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName("loL");
item.setItemMeta(meta)
ShapedRecipe#setIngredient(key, item.getData());
lol np
My Server is crashing (Server has stopped responding). Everything is here explained: https://www.spigotmc.org/threads/server-keeps-on-crashing-server-has-stopped-responding.440669/
@naive goblet or not
why ?
it works with normal diamonds as well as custom ones
so?
oh it works with both?
okay i kind of got a plan
@naive goblet The guide you linked me is outdated and I believe they changed how you register custom entities since then.
alright ty
Hang on @naive goblet I may of figured it out
Big maybe and it may not work
IRegistry.a(IRegistry.ENTITY_TYPE, key.getKey(), entityType);
In IRegistry there's a method with the same name but with an added value
and it's an int value
ShapedRecipe#setIngredient(key, new RecipeChoice.ExactChoice(ItemStack)) @idle zodiac
ah
bruh just use 1.15.2
i cant lo
i need to use 1.8
also
how many times are people going to just answer with "use minecraft 2.0 will you ok"
maybe you'd have to use nms then
Occy the reason why people answer with that is because it's a valid answer
Well then expect to not get support
jesus guys chill out lol
what
let me rephrase
because i'm using a non-orthodox version, i dont get help?
expect to not get the same level of support
just be careful with NMS and you should be fine
also expect to get the most dumbass stack traces for the dumbest reasons
Ok cool, must of got the id wrong. Atleast I know it works but now I have killer parrots.
54
killer parrot,best parrot
Is dyes under material?
How can I get the block behind a WALL-Sign in 1.15.2
I FIGURED IT OUT!!!!
Turns out I don't need to regference the wiki everytime I need to grab an id
and the IDs are wrong there
IRegistry.a(IRegistry.ENTITY_TYPE, IRegistry.ENTITY_TYPE.a(parentType), key.getKey(), entityType);
this is what I did
the id's are in entity types
exactly :d
btw
what would be the most secure way to talk between 2 servers directly? 🤔
ie i'm trying to do a hub npc and sign system for when the minigame is in bungee mode
actually hmm
can i send data to bungee that it will send it to the server that wants it without creating a middleman plugin for bungee?
oh that's actually even better
Hey guys, I followed this: https://www.spigotmc.org/threads/creating-guis-the-right-way.156378/
which is perfect, but I need help with two things, first one being kinda obvious, but ill ask it anyways though I think I know the answer.
- Best way to iterate over each slot to fill it with an item stack?
- With that, how can I calculate every slot that's near the edge, so there's like a "border" and only 7 slots can be filled on each row of 9?
this is where im at. ```
for (Town town: plugin.townList) {
setItem(4, new ItemStack(Material.PAPER), player -> {
player.sendMessage("something");
});
}
slot % 9 = column
slot / 9 = row
as for the first 1
well
iterate over all using for int i - 0; i < size; i++
there is no magic behind it
unless you have extra info about unused slots
Yeah that's what I thought would be the answer, but a little different because of question #2
thanks, ill play around with that.
reminds me that i really should master fizzbuzz... hehe
fizzbuzz being?
@frigid ember it doesnt matter which way u do it, it will be the same and there will be most likely no difference with performance
oh you could improve ram a little by instead of using a map integer yourguithingy
you could use an array
same thing
a page size is fixed same as an array so to me it seems like a win
why would you use a Map<Integer, Inventory>?
also how does that "ram improvement" matter in bukkit plugins
when i change unknown command with colors server doesent start
how i change the unknown command without crashing the server with colors
i mean why not
and?
Are there any exploit/dupe list for between 1.8 and 1.15.2?
IllegalStack plugin may help you @chrome edge
it has big list of exploits fixed
and mentions wht versions
i'm talking about the gui he follows
"guis the right way" ok
this is very bad
@frigid ember Is it only for dupe?
this tutorial is litterally shit
this dude is using static getters for the inventory
tbh he has the right idea
it's one of the cleanest threads i've seen so far.
but yeah he does odd things
"cleanest" more like one of the shitties
method calls from constructor and static methods
let's see yours
let me do it then.
okk
I dont have one coded so it will take a while
that's fine, i'm excited to see an improved version. i actually learned quite a bit from this one so im curious what yours will be
i have this myself tho i'm looking into improving setname
hello, my plugin reads a prefix from the config: '§8[§cBounty§8]§c '
But ingame it doesnt have color, it only has some weird ?
/?
\ ../
looking like that
but only in one command the other works
save it with the utf 8 enc
yeah sorry i got used to it :d
Yea why does he use microsoft word as his ide
But /money works. the same config
Does it use the section symbol
you mean me ?
yea
what's wrong with tabs tho?
§
yes
the config:
Config:
Prefix:
prefixAdmin: '§8[§b§lAdmin§8]§r§c '
prefixHorse: '§8[§dHorse§8]§f '
prefixEconomy: '§8[§2Economy§8]§c '
prefixBounty: '§8[§cBounty§8]§c '
Uurg, legacy chat format
it works all fine but only that command in that java class doesnt work
Ppl should move away now so they can actually use hex colors with 1.16
it makes no sense why it doesnt work
Verilyzed i would recommend you trying to save with utf8 encoding
but all other config parts work
My point is valid in any section
I dont care if its valid
Its not useful
Its not relevant
I can say my opinions but its not appropriate
How do i do this? I am using eclipse
why not just put in your config file & and then translate it?
if i click ctrl s it only saves it. i could open it in notepad++
Hey, can anyone help we with a port forwarding problem I have?
i cant find anything like what i have online
open cmd
type ipconfig /all
find your network you're connected at
look at ipv4 adress
copy that
go into router at port forward
put that ipv4 adress there
then the ports
i have done that
enable and you're done
i port forward my ipv4 address
of the connected address?
(btw i use a server, not my pc)
oh
i port forwarded the servers ipv4 though
wdym?
i can connect to it loaclly before any of the port forwarding steps are done
but if i want it public for my friends to play
they cant join unless i port forward
ping that ipv4
and when i port forward it
see if it returns
the server cant start :l
ok
when you say ping the server, do you mean use a website
sorry if i sound dumb, im new to this kinda stuff :l
the server i use runs of unraid which is based of linux
if you want i can ip config my personal pc
i have tried it with the ip and without any ip
it has the same error
wait no
it doesnt
with no ip
it boots fine
but the port isnt forwarded
atleast thats what it thinks
should i forward my public ipv4 address?
yes
or just have the unraid server ip forwarded
ahhh, ive port forwarded my servers local ip, not my public ipv4 address
is that what i did wrong?
but the minecraft server is not running on my pc
its running on a sperate server in the house
between the server and router
if the server is connected on the same router
you can connect with the ipv4 of the server
I'm trying to block exploit and wanna kick player without delay. Is there any method to force kick player from the server?
when i play on it localy
crash their client
i use ther servers ip address to connect
-_-
((CraftPlayer) player).getHandle().playerConnection.networkManager.channel.disconnect(); I've tried this but doesn't work. (I just tried it idk is it safe or not)
make sure u alowed firewall acsess to java
Oh I think I found it! ((CraftPlayer) player).getHandle().playerConnection.networkManager.close(new ChatComponentText("KICK"));
Anyone know the all players online command since the @a doesn’t work
how do i get a Collection value? because name[i] doesnt work
collection of?
Strings
so i have to convert it first?
yes
okay
¯_(ツ)_/¯
?fw
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
If I set a newline character in a config and then kick/ban a player with that string the newline character isn't making a newline rather it appears as \n, why and how can I fix this?
Fixed. Solution was using ""'s instead of ''s
how would i check what height sugar cane is ?
Block sugar;
Location l = sugar.getLocation().clone();
while(l.getBlock().getType() == Material.SUGAR_CANE) {
l.add(0, 1, 0);
}
int height = l.getBlockY() - sugar.getLocation().getBlockY();
something like that
final ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
service.scheduleAtFixedRate(() -> {
service.shutdown();
}, 20, 20, TimeUnit.SECONDS);
y
|
final ScheduledExecutorService service = Executors.newScheduledThreadPool(1);
service.scheduleAtFixedRate(service::shutdown, 20, 20, TimeUnit.SECONDS);
@red bolt show me more of the code
you cant place that declaration there
or down
not sure
hover over it
it fixed itself now
nothing should be called with a single character anyway
except counters in for loops
how about T that stands for Type
that's not a variable
e that stands for exception
you said nothing
you didnt say that no variable should be named with single character
Hi, does anyone know how to change this text in the spigot api?
why does getblockat need a boolean
???
??
no
the while needs a boolean
^
pretty sure that's client sided @boreal brook you could change it with a resource pack if you want
maybe overriding it with a timer works but i doubt it will
oh, ok thanks, though i saw many servers putting a custom text in it so i was wondering if that's possible
how to get the index number of the integer of Collections.max(collection)
english please
^
not sure he meant that but maybe
i guess
nice
ah makes sense
what is the type of the collection though?
Integer
ok, but the whole type? List, Set?
its a generic type
Arraylist
yeah then thats fine
yeah i just was lazy lol
there is an indexOf method
ah okay i will try
good, just use yourList.indexOf(someValue)
keep in mind collections can have duplicates im assuming you knew that already
wym
Set/HashSet cannot have duplicate elements
he said ArrayList
that's why i said collections
he said collections
collections can have duplicates
whatever
tf you talking bout
to my knowledge yes
Well, you said collections
as in
are you? lmao
no
from the javadoc: "Some collections allow duplicate elements and others do not."
When you say collections, you probably mean all the collections
so yeah this might be a problem
it is better
i have a hashmap of all bounty values connected with the uuid of the player. that i converted into a collection type integer and then converted that into an arraylist. this arraylist i want to sort from highest bounty to lowest with name of the player and but this into an output player.sendMessage() message
why did you convert them into collection and then into arraylist?
have you ever heard of BiConsumer
no
im assuming
it's a thing that consumes two things :3
yes
final Map<UUID, Integer> bounties = new HashMap<>();
final List<Integer> values = new ArrayList<>();
bounties.forEach((key, value) -> {
values.add(value.getValue());
});
^
So is it bad to convert a hashmap to a collection and then to an array or what
final Set<Player> set = Collections.newSetFromMap(new IdentityHashMap<>());
final List<Player> list = new ArrayList<>(set);
U cant convert hashmap to a list
or idk
well
because it has 2 generic types
you can have a list of entries
List<Map.Entry<K, V>>, but that's dumb to use
array?
arraylist
i gave a tutorial up there
Howdy, I am thinking about purchasing @lone hawk 's mineacademy course. I wanted to be a programmer since I was 12 (or earlier?), and started messing around with code back then. Now I am 15, and I don't know if it's the right thing to do. Should I buy this course or not?
i just read (free) tutorials
Spigot Course, but new
^
It's 100 USD. I have the money, and those free things do not work for me.
100 USD for a shit course I guess
😂 I ain't watching these
what doesn't work for you in those free tutorials?
Since my Java experience is little to none, and I've only really messed around with Swift Playgrounds
oh
And want to start learning slowly
well i'd suggest you first learn java
According to that website, they'll start learning Java too.
idk, do a scramble word game in the console, maybe?
??
Like, is there anyone that has tried Project Onion/Spigot Course?
i like how IDEA looks on mac
not me, i literally learned from reading plugin code from my friend and googling every 5 secons 😄
yeah macos is mmm nice ui
StackOverflow
That's the point.
Project Onion seems like a consistant and slow-phased learning course
I don't really mind the money, I just want to learn how to code whilst it being fun, interesting, and understandable
And when I used Swift Playgrounds, or got lessons at school, it was genuinely fun
tbh do what you want, does the course have some free samples in it? do you like them?
you dont need waste money on trash courses
i recommend you to take udacity course
its free
and you will learn alot
hey does anyone know how to take a commands contents and put them somwhere?
hello?
😦
define 'contents'
presumably parameters
not to hijack the guy from 15 minutes ago - but, i'm starting to have a go with java
i'm building with gradle, but it's not including the plugin.yml file
it exists in the src folder, but
it's just not being added to the jar file
how do i add it?
why don't you put it in resource folder?
i'm so sorry if this is so simple, i'm somewhat familiar with java as i'm currently doing c# at college, but gradle is so confusing lmao
you mean the java folder?
i'm an idiot 🤦♂️
nah, we all have to start somewhere 😄
second problem now:
[17:39:21] [Server thread/ERROR]: Could not load 'plugins\FirstPaperPlugin-1.0-SNAPSHOT.jar' in folder 'plugins': uses the space-character (0x20) in its name
(ignore that it says paper in the name, i was gonna try that but then my mate said to try it once mastering spigot first)
alrighty nvm, plugin.yml once again haunting me
@limber sierra because you have a space character in its name?
correct
(ignore that it says paper in the name, i was gonna try that but then my mate said to try it once mastering spigot first)
@limber sierra spigot and paper is the same thing
also what does mean "mastering spigot"?? lol
more like mastering java rather than spigot
its not that hard to learn an api
apparently half the stuff in the paper api is renamed?
Not necessarily
then why learn paper rather than spigot
when its just renamed?
i dont understand lol
true, true
do whatever you want though.
hey i mean
i'm just messing about rn ¯_(ツ)_/¯
there's no way anyone's gonna take this seriously https://deeppanalbum.party/G1jyBu.mp4
nice ip logger
Technically all the code from the original source has been renamed several times, obfuscated, deobfuscated, new apis
would you open a stranger's .exe file?
open it on browserling if ur scared, but it's just a video of the plugin i made lmao
bruh
it's an mp4
an mp4 doesn't inject into your computer
...
Compare the javadocs between paper and spigot
not that much difference, now i'm actually looking at it
eh, guess it's a valid point tbh
Paper adds further optimization and some methods, but it uses a similar approach to spigot when it does that
i'll start messing about with paper api then
Its not that much optimized, its still pretty much shit
and paper cant handle alot players on single server
another thing, i think minecraft servers should be multi-threaded
would be way better
which is why i'm using tuinity on servers
tuinity is a Paper fork...
exactly
read the desc https://lucent.host/n8uQx2.png (changed link since apparently my domain is an ip logger)
What are you basing that off of? If paper is limited it’s because of minecraft itself
oh man you're funny
A potential problem with so many forks is that it starts to dilute the support and development across all of those forks to a degree, especially since they’re all volunteer projects
imo, Spigot or Paper, that's it, don't waste money on shitty fork
imagine buying forks
that's just 100% retarded
paying for modifications on the free works of others
@sturdy oar that's like, what MCMarket is??? 😆
is just non-sense
yea
It’s like creating a new denomination of a church; everyone wants to goldilocks tweak the rules so their porridge is just right. In the end it’s all spread to thin and unpalatable
I also like stuff like GlowStone and Cuberite
sadly they are small and still haven't managed to go past 1.12.2
but it's pretty cool that they do not rely on Mojang's code
Well a fair number of servers still run 1.8, so
when will Mojang add PVP gamerule 😒
i mean i think 1.8 is just something like 17%
Hi all, for an IOT project I'm trying to have a plugin make use of Google Cloud, and further would like to make use of the following classes in my plugin...
import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.cloud.pubsub.v1.AckReplyConsumer;
import com.google.cloud.pubsub.v1.MessageReceiver;
import com.google.cloud.pubsub.v1.Subscriber;
import com.google.common.collect.Lists;
import com.google.pubsub.v1.ProjectSubscriptionName;
import com.google.pubsub.v1.PubsubMessage;
I'm using Eclipse as my IDE, where I've installed the Google Cloud extension and added the necessary libraries via Project->Build Path->Add Library->Google Cloud Platform Libraries.
The the plugin.jar compiles and is created okay, and noteably with only one .java file it is 28 MB.
To me this indicates that the Google Cloud .jar files have been included in the plugin.jar?
When I export my plugin, I'm using the JAR file option, with the standard .classpath and .project unchecked and plugin.yml checked.
However when I run my plugin I get a NoClassDefFoundError exception whenever I try to use one of the Google Cloud classes...
This is the first time I've tried to include some additional library into a spigot plugin, so please excuse my lack of understanding here.
These classes, or library.jar files must be in my plugin.jar no? Otherwise why would it be 28MB? Is there something simple that I'm missing?
are you using Maven or Gradle
they have to be included so how else should the libraries be used?
Uhhh... Neither. Excuse my lack of understanding but I don't quite understand the difference. Aren't they included hence the 28MB file size on the plugin.jar?
yes
So if they're included... how do I use them? 😛
com.google.pubsub?!
Is that Google's propritary MQTT
it should be auto-added to eclipse's code complete and you should be able to use the classes from it
assuming the imports aren't erroring its working properly
You checked the jar contents for the classes?
When I run the plugin, whenever I use one of the classes it throws a NoClassDefFoundError.
I should note, that if I just simply make a runnable java application it works fine.
as in, a separate application using those classes
I haven’t used eclipse for so long, I found it tedious, sluggish and underwhelming.
At least in contrast to idea, which is also free
😆
Does anyone know why /tpa doesn’t allow players to accept or deny? It gives the option to do both but they’re automatically teleported
I would need more context to understand
I have my own code that provides those features and there are other plugins that do the same
When we /tpa we automatically teleport. Perms are for to accept and to deny. I use essentials
tpa is an alias of tpask though?
so it's probably another plugin
It does
Idk what other one it could be, unless it’s the random teleport one. But it did it before that was added
You probably have auto teleport enabled
I just looked at the code and permissions, if you have auto teleport enabled it skips sending the request
essentials.tpauto.others
make sure that’s unset or false
Ok. I’ll look. Thanks 🙂
I have this little doubt, I have two classes currently implementing ConfigurationSerializable and marked with annotation @SerializableAs, inside those classes i also have long field that represents the serialUID of the class
should the serialUID be transient ?
Is there a reason for including the UID? I don't see that in some of my custom configs, where I use the same mechanism.
When I initially implemented them, I did, but then I realized it wasn't necessary to include a field for that purpose.
I think this is a feature of java serialization
As since 1.8 you should use UUID for storing player data.
They're using the bukkit api for serializing a class into a config file
which is different from UUID
@sturdy oar @SerializableAs is supposed to provide the serialization api with a simplified name used to identify your object; which should end up removing the serialUID.
It gets rid of a lot of extra stuff, that reduces the readability
bukkit is still able to figure out how to deserialize your class
Is there a command for sending something to all players online? I’m trying to set up my online store by @a doesn’t work.
But*
challenge:
==: Challenge
duration: '30'
name: Adventurer Challenge
rank: Player
objectives:
- ==: EntityObjective
mobName: ':wolf:'
minGoal: 3
entityType: WOLF
name: Ambushed By Werewolves
description: 'Kill %s %s.'
withoutArmor: 'false'
maxGoal: 5
@sturdy oar it leaves out the fully qualified name of the class; and you end up with something like the above. ==: NameSpecifiedInSerializeAs
@frigid ember You'd probably need to schedule a repeating task, and track the initial time the event was fired and provide it the the constructor of whatever Task you create
well I also have a deserialize method that i built on my own
You usually have to define one as part of the api
for ConfigurationSerializable
but you don't need the UID for that to work
yeah
@sturdy oar ```java
public Objective(Map<String, Object> args)
{
try
{
name = (String) args.get("name");
description = (String) args.get("description");
emojiDescription = "";
minGoal = (Integer) args.get("minGoal");
maxGoal = (Integer) args.get("maxGoal");
recalculateGoal();
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
so you're saying i could just do the casting from the constructor?
Yeah this looks weird
now that I think of it
public Challenge(Map<String, Object> args)
{
this.name = String.valueOf(args.get("name"));
this.duration = this.originalDuration = Integer.parseInt(String.valueOf(args.get("duration")));
objectives = new ArrayList<>();
this.objectives = (List<Objective>) args.get("objectives");
for (int i = 0; i < Win_Max_Slots; i++)
{
TextComponent text;
switch (i)
{
case 0:
text = new TextComponent(FIRST_PLACE + " ");
break;
case 1:
text = new TextComponent(SECOND_PLACE + " ");
break;
case 2:
text = new TextComponent(THIRD_PLACE + " ");
break;
default:
text = new TextComponent(CONSOLATION + " ");
break;
}
rewards.add(new BaseComponent[]{text});
}
}
the objective class is serialized and is part of the challenge class
since it implements configuration serializable you can just cast it
so Bukkit does all the 'serialization part' that I'm currently doing by hand?
you just have to specify how your class properties deserialize using the map
and vice versa for serialization
mh cool, I will change this asap
Location implements it as well
Those two for certain, but it's relatively straightforward, though confusing at first.
does that work on BungeeCord as well?
for loading configuration?
why doesn't bungeecord use the same YAML API that Spigot uses? That's a thing I've never understood
I haven't needed them yet, but I've seen plenty of examples for plugins that do
even net.minecraft.server includes examples, which you can see if you've run buildtools or build Paper
I don't know all the details behind the history of bungeecord, I'm only familiar with what it does; I haven't run a setup with it
well sadly I'm making a JAR that works both on BungeeCord and Spigot
so I'll have a lot of duplicate code i think
I would look into something like gson then
it may be included in bungeecord already. Pretty sure it's a dependency included in the spigot jar, but I would double check that.
does GSON read YAML?
i thought it was only for Json
also yes Gson is shaded into Spigot
well you see, I currently have an 'AbstractValues' class
sadly Bungeecord Configuration
has basically the same methods of Bukkit Configuration
but they don't have anything in common
so I can't generalize on that
https://paste.gg/p/thevipershow/27fccec1a3444e64b7469b0a1db7269b
this is my context
are all of those enums your defaults?
In EnumConfig?
@frigid ember I would refer to this https://bukkit.gamepedia.com/Scheduler_Programming
You don't want to lock up your server for 10 seconds while it waits to check the elapsed time; which is why you schedule a task or repeating task to check after a delay, or repeatedly.
@sturdy oar The bungeecord config module includes gson and snakeyaml
https://github.com/SpigotMC/BungeeCord/blob/67c2dfd8848689c6d5052fbc99b3bc92a6d21ea2/config/pom.xml#L21
https://github.com/EssentialsX/Essentials/blob/e4cc78a750082ca5089edac5fd3621a9f2a4d38a/Essentials/src/com/earth2me/essentials/commands/Commandtpa.java#L31
@red zenith so what do I do to this to make it non-auto?
How are you managing player permissions, and is anyone op'd?
Well, I generally avoid op and use groups with luckperms to assign permissions instead
I’m the only one with op
Luckperms gives you a default group to start, that's applied to everyone
op overrides most permissions
which is why I don't use it, can make it difficult to test certain functionality
can you DM me, I want you to share what luckperms shows in the editor
/lp editor
that'll give you a link to a web interface, where you can see all the permissions you've set
You want to check your default group and look for any thing that starts with essentials
if you're using any wildcards: essentials.* or have an entry for essentials.tpauto.others
I know how to use lp. I’m telling you that every person that is lower than admin does not have that .
But it still auto tpas them
So you've checked all your permissions for your default group and no one has wildcard permissions for essentials
and you're just running one minecraft server, no bungee or anything else?
and you have no other plugins that implement any kind of /tpa
the one provided by essentials?
No.
so the only thing that plugin does is provide /tprand or /wild?
Yes
Hey, It's my first time developing a plugin, and I'm trying to make a sound play when a player enters the command. I did p.playSound(Sound.BLOCK_NOTE_BLOCK_BASS); However I have formatted this incorrectly. Does anyone know how to correct it?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#playSound-org.bukkit.Location-org.bukkit.Sound-float-float-
you need a the location first - where the sound will play, then the sound, then, the volume, pitch
(hint: set them to 1.0)
thanks so if I want it to play (location) on the player it's just "@p"
ok
thanks
great it works! Also that website frost sent is quiet useful, ill refer to that!
@rain plank The only other place where the auto teleport might be configured is in the players data file for essentials
so in your plugins/EssentialsX/userdata each user should have a .yml file that includes their name and UUID in the title
look for teleportauto
Did you follow an example somehwere?
public void only needs to come at the beginning of the line where you define your function
If you're not sure about the conventions of java, I'd encourage you to find some resources online that will help you learn
ah I see what you mean
you mean like this?
@EventHandler
public void onJoin(PlayerJoinEvent event) {
// Create the task anonymously and schedule to run it once, after 20 ticks
new BukkitRunnable() {
@Override
public void run() {
// What you want to schedule goes here
plugin.getServer().broadcastMessage(
"Welcome to Bukkit! Remember to read the documentation!");
}
}.runTaskLater(this.plugin, 20);
}
The reason why you have that method run inside the onJoin method, is that you're defining an implementation of BukkitRunnable() inline, and it requires you to define the run method; which has the method signature public void run()
well, you have some issues with that
why did you have 2 argument for event handler?
you cannot listen to two events in one EventHandler
you would need two seperate eventhandlers
but that's not the only issue
you don't want your function to run a while loop in your event handler, like that
that's where you need to schedule a task/runnable
because your sever won't respond to any other requests while that timer is running?
I shared that with you earlier, I thought.
I’ll work on the configs when I get home
if your sever is running properly, there should be roughly 20 ticks per second
when your event triggers, you store the current time in milliseconds
then your task runs every so often, until you stop it
and gets the time in the same way
and compares the two
don't just assume that your 20 ticks actually occured in 1 second
anything that stresses your server will lower the ticks per second
If you want a reference check out the code for griefprevention. It has a feature that lets you siege another player's claim, and if a flag is set, that player dies if they try to logout
That's not a straightforward example
but it does demonstrate a custom task that is run when someone is sieged
How do I add a tooltip as part of a message
you mean something you can mouseover?
yeah
@frigid ember what do you use to check if the player is in pvp combat? how long do you keep them in that state? So when you check if they're logging out, that they'll die?
https://www.spigotmc.org/wiki/the-chat-component-api/
look at HoverEvent
thanks
Are you trying to prevent logout when in combat with anything? or only with players?
Whats an enum constant?
do mobs spawn less on spigot servers? My friends and I have a multiplayer server and we built a creeper farm but its not as efficient, I lit up the whole area and built it correct but mobs barely spawn. Is there a way to change this?
I've had an issue with that for some time, I created a modification to mob spawning because by default vanilla mc server does not evenly split the spawn across players
it's more of a first come/first server basis
I think Aikar has a fairspawn plugin, I don't know if it's maintained or not
ok
Nice
In fact I have the opposite problem right now, I have way too many mobs spawning and I need to adjust my code
I go to the nether and ghasts everywhere, used to see practically zero
bukkit and spigot configs have parameters for adjust spawn factors
should my friend put the change the bukkit.yml?
/summon minecraft:football_player
hahahha
nice meme
🙂
well
um
does anyone here know how to take the contents of a command i make and put it somewhere else?
it would rly be a pleasure if you help!
🙂
are you asking how to keep track of commands entered?
for animated frames
and using the data from the replace command
it's going to give that data to other commands and execute them
it's putting to old thing to gether and making something new
so first
it's going to execute the remove command
then the create command
you'd probably have to create your own plugin, to create a command that'll do that
by animated frames, you mean item frames?
yes
you mean paintings or item frames?
by replacing it i keep the name but take the old url of the picture
and put in a new one
but keep the name
ya get me now?
so you have a painting which you've named, with a nametag or in code?
and you want the contents of the painting to change?
but not the name
so
taking the value of the name and keeping it but throwing the url away and placing a new one via command...
wait, so you're trying to display a custom image, and not just cycle through the ones available?
I think it's important to clearly state what your trying to change
If you're just cycling through the available artwork that's part of the default client, that's one thing
/replace (name of image you want tor replace) (url here)
but if you're using custom, then you obviously have to provide that to the client as well
then it gives it
to other commands to execute
/remove (name of image you want tor replace)
/create (url here)
but their asynchronous and delayed
give me a basic scenario: Start by describing the original item, and then an example of what you would change it to
bless you
i just do the replace command and it gives you
well it makes
you
because im using player.chat
so basically custom images
and you want to display those in game?
it's already set
so you've already got that working?
im just trying to change the contents
well with a plugins help yes
just adding my own little command to use
and this plugin manages the loading of the images from a url, and transmits that to the player's client?
Does this require a forge client or something non standard?
that's the part I'm trying to understand
Is there an equivalent of onTabComplete on Bungeecord ?
They have a discord, don't they?
Sorry to bother so often, I've been trying to apply the hover event, and copied the example text on the spigot website, however I haven't been successful. If I send the text could someone assist me?
but the point is to switrch content
if you want @red zenith i could friend you
so we could talk un interrupted
🙂
Is the plugin that you're using available somewhere? the code?
yeah
it's called animated frames
it worls rly well
works
it can do gifs and images
tho i can make a few bugs happen
🙂
by doing some stuff
wow @strange grove thats a cool plugin u made!
no it's not mine
im piggybacking of it
but not gonna post it
butr i can give you the link
im just making a new command
XD
so i can use it personally
for my server
anywho
so anyof you know how to transport command contents?
have you tried giving a url for the image to the command in animated frames?
well
yes
but that is not the problem
there is not a replace command
and it takes longer to replace an image
so im making a new one for the plugin
"that is not mine!" @rough hare lol 🙂
yeah ik
heh
still cool tho
are you trying to avoid having to save the images?
so you just want to add an image to the list of images that AnimatedFrames can display
and then the create command
and then replace one that you've already created?