#help-archived
1 messages · Page 184 of 1
And English is not my native tongue either, that's not really an issue here
That's really not useful if you don't show what object you're trying to use this method on.
But it's really quite simple.
You use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/meta/BookMeta.html#spigot()
declaration: package: org.bukkit.inventory.meta, interface: BookMeta
declaration: package: org.bukkit.inventory.meta, interface: BookMeta, class: Spigot
yes
Actually, yes, it does require an array for each vararg
But you can simply create one of one element, i.e new BaseComponent[] {arg1}
You don't need to create any new BaseComponent objects, all you need is an array
ArrayList?
i really dont understand what i need to do - can you please write it?
Which slots are the players' inventory? in InventoryClickEvent#getSlot()
012345678
You can check which inventory they clicked on
oh with e.getClickedInventory()?
Exactly
If that's an instance of PlayerInventory, it'll be the player's inventory
oh easy
bruh thank you finally BaseComponent[] vote = {Text, NormalMap};
vb.setTitle("§6Click to vote!");
vb.spigot().setPages(vote);
Well, that'll make both the text be on one line
You need a separate array for each line
just add \n
I don't think that works in a book
i have it in textcomponent already...
it does work in a book i've used it
look at that code
you need to add \n to the end of the textcomponent string
TextComponent NormalMap = new TextComponent("§21. §6Normal" + nl + " §3" + votesNormal + " Votes");
TextComponent Text = new TextComponent(" " + nl + " §8§nClick to vote" + nl + " " + nl);
-.-
I said i have it
already in code
Ah, you're treating it all as one line, I guess that'll work then
don't know why you're using attitude you put nl without any context of what it was in the actual code
String nl = "\n";
interesting how Bukkit.createInventory(player, InventoryType.CHEST, displayName); implies a 27 slot inventory
when chests can be both 27 and 54
You can specify the number of slots
in the method?
mhm
Yes
i swear i looked on docs and couldnt see that lmao
yeah but
9, 18, 27, 36, 45, 54
i can't specify slots and inventory Type
for my use case i need inventory type
because i check it later on
but the problem is i cant create inventories of type Chest with 54 slots
declaration: package: org.bukkit, class: Bukkit
The javadocs is clear, it'll be of type Chest
wait im confused i dont understand your question
if you just need a chest
just use put 54 instead of inventorytype
and then when you check it
oh sweet
chcek if
inventory.getType() is an instance off
uhh
declaration: package: org.bukkit.inventory, interface: Inventory
one of these i believe
What?
got it now
sorry nevermind
yeah
getType returns an InentoryType enum
yeah my bad
xd
yeah when you check in a listener you can just do
if (inventory.getType() != InventoryType.CHEST)
{
return;
}
//do chest stuff
or
if (inventory.getType() == InventoryType.CHEST)
{
//stuff here
}```
1st is better
Well, neither is really useful in the context of creating an inventory
And not much use when listening to clicks either
there is no way to get commands help in waterfall/bungee i think
Im getting insta disconnected when i try to join my minecraft server. "main" is what bungee should transfer players to when joining and is my only world.
Nope, but it has a wide collection of their own plugins too
i see
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = false)
public void onSpawnEntity(SpawnEntityEvent event) {
Object cause = event.getCause().getRootCause();
if (cause instanceof Player) {
if(!event.getEntity().equals(Vehicle)) {
return;
}
Player player = (Player) cause;
//EntityType type = event.getEffectiveType();
for (Entity entity: event.getEntity()) {
if (boatFlagEnabled(entity, player)){
event.setResult(Event.Result.ALLOW);
}
}
}
}```
I'm using a worldguardapi event
but it doesnt recognise 2 things :/
if(!event.getEntity().equals(Vehicle)) {
for (Entity entity: event.getEntity()) {
how do i stop a sh script
@bold anchor
too late
imma spread it everywhere
@prisma falcon Do you mean externally or from within the script?
uhh, wdym
Are you writing a shellscript yourself?
Then it should run only once. Takes a second max.
got it
The script doesnt run anymore. It just ran once for half a second after executing.
Are you using "screen"
i got it!
ok
Anyone know how to access the daimon/what is a daimon in multicraft :/
I wanna use databases in my plug-in but idk how to do, and which type choose between json or mysql 😬 Someone can help me pls?
json isnt a database. I think you mean MongoDB.
I think mysql is easier if you have no experience with databases.
@grim halo the manager creates the LockGUIs?
Love the video or need more help...or maybe both?
💬Join us on Discord: http://discord.gg/invite/fw5cKM3
Thank you for tuning in to this episode of TheSourceCode! ❤️
If you enjoyed this video make sure to show your support by liking , commenting your thoughts, and sharing for...
Yes the manager creates the guis and opens them for the player
internally the manager stores them in a map<Inventory, LockGUI>
ok, thanks
a spoiler called spoiler monkaS
not sure why discord did that, i jsut dragged and dropped
What even is that log...
idk...
Are you trying to bind to the port that the server is running on?
Or maybe you already got a server that is bound to that port
my old bungeecord was binded to that server, ive stopped it. my domain name should forward it to 25565 and then forward it to the actual server at 25566
Or maybe you already got a server that is binded to that port
i think i didnt close velocity properly
binded... what am i even typing. *bound
Anyone know how to access the daimon/what is a daimon in multicraft :/
what is that? -> daimon <- thats not a word i think
does velocity have a console to input commands in?
@grim halo its something in multicraft?
isnt it just a waterfall fork? So it should have console interaction.
Its like a file thing
no command prompt console pops up when i open the velocity.jar file
i think ive missed something to enable console interaction
What do you mean by "open the velocity.jar file" are you on linux?
Hey guys 🙂 For a hashmap if I use myMap.put(), but an entry already exists with that key, will the value linked to that key just be overridden?
yes the value will just be overriden
nice
Ok and how exactly do you "open" it?
double click lol
make a bat file?
Are you on windows
yeah
some jars are able to handle being double clicked
typically minecraft ones don't handle that properly
Yes but you will have no terminal to interact with in this case
when have a server gui
like for spigot
some jars are able to handle being double clicked
^^
so, how do you open it?
java -jar (jar file name)
still hard to believe that despite how many tutorials there is on running minecraft stuff
people still fail to read the basic stuff o.O
Class you need to go into your taskmanager and randomly kill every java process.
After that make sure to only start your servers with bat files.
Is there any event fired when a user is kicked/banned?
PlayerKickEvent
Ah! @wind dock Are you talking about a daemon?
What about banned event?
its the same
Oh that's great
Here are all player events
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/package-summary.html
declaration: package: org.bukkit.event.player
yeah first thing I did was check for an event in the javadocs, but I didn't see PlayerBanEvent so I thought it would've been under something else
just use generic words in the javadocs
in this case if you just use the word event you will get a list of all the events 😛
Class you need to go into your taskmanager and randomly kill every java process.
After that make sure to only start your servers with bat files.
alright, ive done that.
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/Event.html
@graceful vigil also in case you didn't know about the javadocs, if there is sub classes of a class, it will show them to you as noticed at that link
declaration: package: org.bukkit.event, class: Event
you can see all known subclasses of Event 😛
for future reference whenever looking through events lol
or something else
I'll keep it in mind for the future, thanks
Are you sure that you need a proxy?
yeah, currently using tcp shield
trying to host a server for a friends instagram page....
not exactly sure what im doing, only have bungee experience lol
obviously you don't otherwise you would know the problem here since it kind of tells you in the logs
okay
is your lobby server up and running?
yes
and then configurations set appropriately?
they should be, they worked on bungee fine before. theyve just stopped working once ive added tcpshield proxies
Does anyone know what the EntityType for a skeleton horse is, on the JavaDocs it says SKELETON_HORSE but that doesn't work
third you are using velocity which is a proxy I am unfamiliar with but going to assume it is a bungee fork
its a waterfall fork
and waterfall is a...?
[19:11:43] [main/INFO]: Proxy is running in offline mode!
[19:11:43] [main/WARN]: Player info forwarding is disabled! All players will appear to be connecting from the proxy and will have offline-mode UUIDs.
^ that is your problem
waterfall is papers fork of bungee
Is your main server running in offline mode?
@grim halo yes
k
hate offline mode networks -.-
Then go ahead and try running your proxy in online mode
@keen compass You dont really hava a choice if you want a proxy i think...
the servers need to be offline
Maybe he don't have bought client
Maybe he don't have bought client
@rare prairie i do, but friends dont
k
Yes. You just need to make sure the player can only join via the proxy
I don't support piracy so I am out with the support
Does PlayerMoveEvent include head rotation?
Yes
sweet
Does anyone know what the EntityType for a skeleton horse is, on the JavaDocs it says SKELETON_HORSE but that doesn't work
@round igloo Don't want to sound annoying but in case you didn't see ^
18.07 14:22:46 [Server] INFO at org.bukkit.craftbukkit.v1_13_R1.util.CraftMagicNumbers.checkSupported(CraftMagicNumbers.java:209) ~[patched_1.13.jar:git-Paper-173]```
My server keeps crashing with this error
You run a 1.16 plugin on a 1.13 server
I'm trying to run worldedit
Or the other way around
download 1.13 world edit
It isnt the normal one?
@round igloo Don't want to sound annoying but in case you didn't see ^
and whats your code?
NPCRegistry registry = CitizensAPI.getNPCRegistry();
NPC horse = registry.createNPC(EntityType.SKELETON_HORSE, color("&a[" + player.getName() + "&a] The Snowman Rider"));
I've made a function for "color" by the way
Did you get any exception?
It just says it cannot resolve symbol
Wait worldedit is 1.13.2 till 1.16, does that mean I can't use it on my 1.13 server
o.O
It just says it cannot resolve symbol
can you send here a screenshot about "cannot resolve symbol"?
cannot resolve symbol... cant you even compile?
most likely the IDE just being screwy. Most times restarting the IDE fixes that problem
or they don't have the API
I'll try that
and server jar
or you not built your project
never had that problem
I mean generally you don't need to build your project before you are done 😛
I'll try to build it
because there are features in IDEs that automatically builds your projects
if you save your work
you set your IDE to compile when you save?
no
Yeah it didn't build
anyone knows why this dont work? new Thread(() -> { while(count == 20){ SelectWinMap.selectWinMap(); Bukkit.broadcastMessage("§8[§6Vote§8] §7Map §6" + Map + "§7has won! §3(" + MapW + "Votes)"); } }).start();
count is never be 20
What am i looking at here?
What doesnt work?
everything
depends on the scope of count
think they wanted it to loop 20 times
is count initialized?
20+ times
oh I know your problem
what?
you are creating an anonymous inner class
and?
you need to intialize count at the top of the class
otherwise the new thread can't access the value
uhm... i think if you make the variable count effectively final you can acces it from the stack the thread is started from
again why would there be? is there something wrong with your syntax?
runtime errors are not detected before well, runtime
XD
cant be made final
it certainly can be static
if it cant be made final then you wont be able to compile
public static int count = 60;
@grim halo im having a problem
player.closeInventory();
LockUI LUI = ChestSec.PublicLockManager.get(e.getInventory());
player.sendTitle("Debug", ((Sign) LUI.sign.getState()).getLine(1), 1, 5, 1);
```when the player clicks the item i close the inventory so i can send a title to the player and check if it works
but id have close the inventory (causing the manager to destroy it), then id have to call the manager and get the LockUI (that got destroyed)
public static void CountDown(){
new BukkitRunnable() {
@Override
public void run() {
if (count == 0) {
RunGame();
}else{
count--;
coutdown = "" + count;
}
}
}.runTaskTimer(Bedwars.getMain(), 0, 20);
}
sure or static. If your count is in the heap then you can access it
and
I pretty much stated this
whats the problem so?
did you run it?
what?
you are asking about a problem, but you are saying the IDE gives no errors
yes
IDE's don't give errors for runtime errors
Do you know actually what is java? @frigid ember
Just asking
i know
k
but you dont know what i mean
but your syntax is correct
therefore why would there be a runtime error for a value that isn't set properly?
if it isn't null
atleast ill try it
its perfectly good code to the JVM 😛
doesn't mean you will get the result you want however 😉
new Thread(() -> {
while(CountDownRunnable.count == 20){
SelectWinMap.selectWinMap();
Bukkit.broadcastMessage("§8[§6Vote§8] §7Map §6" + Map + "§7has won! §3(" + MapW + "Votes)");
}
}).start();
Ok lets start again. Could you pls give us a bit more context petako
Ok. Is count 20 at the moment you start the thread?
nope
then the while loop will never start.
public static int count = 60;
it just skips the loop
look at what i sent
will always make it false unless you have something that modifies the value to be 20
I see nothing setting count to 20
public static void CountDown(){
new BukkitRunnable() {
@Override
public void run() {
if (count == 0) {
RunGame();
}else{
count--;
coutdown = "" + count;
}
}
}.runTaskTimer(Bedwars.getMain(), 0, 20);
}
Yes. But is the count exactly 20 when you start the thread?
If not the code just runs once and skips the while loop
its in THREAD
do you not understand that anonymous inner classes are still separate classes? o.O
i have this
new Thread(() -> {
while(Bukkit.getServer().getOnlinePlayers().size() <= 11){coutdown = "§aWaiting...";
}
CountDown();
}).start();
the only difference is they exist in one file, but to the JVM it is two seperate classes
because methods can be accessed from other classes
im speechless
oh
you are not comprehending the difference between a method and a object
that is one solution of a few you can do
is the. count exactly 20. at the moment. you start. the thread?
If not -> the while loop does NOT start. It is skipped.
@grim halo aside from that, there is other problems as well
ITS IN THREAD
threads are not magical
Everything in this code is a problem
bruh that thread is in on enable
just fyi
most of the API is not thread safe
should probably not use API methods in threads, but aside from that, you have some problems with your code
public static int getCount() {
return count;
}
What is that?
well if you are expecting me to spoon feed you code, then I am not going to do that. However you obviously have very little understanding in how java works though
its correct?
have no idea, not my project
no the method is not even static
so I couldn't tell you otherwise
method doesn't need to be static @grim halo it is by far the easiest solution, but not actually required
its need to be static
He's probably just misnaming things (i.e not in accordance to the convention)
or just has a lack of understanding in what they are doing XD
imagine following naming conventions
Also if you want to share primitives between threads you should use atomics
only if you need them to be accurate
i know what it doing
but using synchronized is enough for that though
atomics are completely different however
smile, can you answer my question if you are available?
i dont think you can synchronize primitives... only methods accessing them or the wrapper objects
you can synchronize any method
sure but you cant do something like:
int a = 10;
synchronized(a){
a++;
}
you wouldn't want to do that on an immutable wrapper anyway
if there is only one... then ok
but, generally most of the time the method that updates such things
isn't being accessed from multiple threads to be updated anyways
usually just read
if it's not read-written concurrently just use a volatile primitive
@stuck quartz one moment pls ill look ar what you wrote in a min
im having a problem
player.closeInventory();
LockUI LUI = ChestSec.PublicLockManager.get(e.getInventory());
player.sendTitle("Debug", ((Sign) LUI.sign.getState()).getLine(1), 1, 5, 1);
```when the player clicks the item i close the inventory so i can send a title to the player and check if it works
but id have close the inventory (causing the manager to destroy it), then id have to call the manager and get the LockUI (that got destroyed)
how can i remove an resource from my spigot account?
this is what i wrote
@crystal fog report it and state you want it removed
where? i've already contacted the e-mail
go to the resource page of the plugin
report it
in said report, state you want it removed from your account
still not working....
@grim halo I will let you handle this 😛
don't really have the patience for this at the moment XD
thanks
@stuck quartz cant you just repoen the GUI afterwards?
If no -> add a boolean shouldBeClosed to your LockUI and check in on close if it should be deleted or something
you're welcome
@stuck quartz you can close inventories without destroying them just fyi
generally if you have inventories that are not going to change. IE they are a gui menu or sorts
never get rid of the inventory object for it 😉
saves you from re-creating it all the time
@frigid ember ?paste could you paste your code?
?paste
thx
commands don't work if you type after them =/
also doesn't work if you try to put it on its own line as well
unfortunately
Where do i find all the commands anyways?
!HELP 😦
guess it doesn't message you
anyways the commands can be found on Irc server in channel #Cafebabe
I don't help the popo
https://paste.md-5.net/oqidepufel.java @grim halo
i've just donated, how can i edit my nickname?
uh I think someone does it for you
you must donate 10+
https://paste.md-5.net/oqidepufel.java#L25
should be getCount();
Why is the thread dangling there?
probably because they don't want to show their main class
you must donate 10+
@frigid ember i've donated 10$
because they love to keep you guessing in what is going on @grim halo 😉
Why not obfuscate it before sending? Would make my life much more easy
supposedly the method at top is in the onEnable()
ok...
that is all I know lol
The thread gets started right away. right?
yes
and the count starts with a value of 60?
when are players 11+
then this here:
while(CountDownRunnable.getCount() == 20){
SelectWinMap.selectWinMap();
Bukkit.broadcastMessage("§8[§6Vote§8] §7Map §6" + Map + "§7has won! §3(" + MapW + "Votes)");
}
Is skipped. Because 60 is not 20
its start
I wonder when they will realize that threads die after they have executed their code successfully unless there is a loop to keep it going 😉
WTF
So the thread starts -> runs the code once (skipping the loop) -> then ends
no
yes that is exactly what happens
ok
so can you tell me why this work?
while(Bukkit.getServer().getOnlinePlayers().size() <= 11){coutdown = "§aWaiting...";
}
CountDown();
}).start();```
Put a System.out.printline after the while loop
while(Bukkit.getServer().getOnlinePlayers().size() <= 11)
@frigid ember you have a loop ^
Because .size() is below 12 when the thread starts
modify the condition so that it is true for it to execute it
Could someone help me:
https://www.spigotmc.org/threads/chats-for-worlds.452421/
SpigotMC - High Performance Minecraft
Dear forum,
is it possible do have a chat for a each world so that only the people in the same world can read your chat message and how do I do this....
Want my recommendation or a quickfix?
or inverse the condition
Want my recommendation or a quickfix?
while(true){
if (getCount() == 20)
SelectWinMap.selectWinMap();
Bukkit.broadcastMessage("§8[§6Vote§8] §7Map §6" + Map + "§7has won! §3(" + MapW + "Votes)");
}
@craggy lynx yes it is possible. You have two methods to make this work. Either use the conversation API, which is what I recommend, or keep track of messages of who is where and send the appropriate messages to the right places.
Yes. I dont care anymore. Just use while(true).
lmao
xD
Alright, going to watch some comedy now
me too
@grim halo
Inventory inv = player.getInventory();
player.closeInventory();
LockUI LUI = ChestSec.PublicLockManager.get(e.getInventory());
System.out.println(ChestSec.PublicLockManager.get(e.getInventory()));
System.out.println(ChestSec.PublicLockManager.get(e.getClickedInventory()));
player.sendTitle("Debug", ((Sign) LUI.sign.getState()).getLine(1), 1, 5, 1);
ChestSec.PublicLockManager.destroy(inv);
``` im going to try to destroy the LockUI manually, this way
if i used shouldBeClosed it would stay on the manager forever (not forever forever, till the plugin is disabled)
@craggy lynx yes it is possible. You have two methods to make this work. Either use the conversation API, which is what I recommend, or keep track of messages of who is where and send the appropriate messages to the right places.
@keen compass And how can I "stop" chat messages, copy them and send them to a specific world?
depends which method you choose
if you are going to go with the manual method, which is the second option I stated, you will have to listen to the appropriate chat event
basically you are going to be cancelling the chat event, grab the message and player involved
then you will get the world from the player object, then get all the players in said world
send the message to all players there
I am gettomg this error
https://hasteb.in/agukamif.apache
Here is my code
Inventory inventory = Bukkit.createInventory(player, InventoryType.ANVIL);
player.openInventory(inventory)
or...Conversation API you don't need to do all of that
you just add people to the conversation in the world they are in
and the server will handle that 😉
@keen compass
Something like that: event.getMessage()
well it is going to be playerchatevent
or playerAsyncchatevent
one of the two
anyways, have fun. Those are the two ways I know of, well technically know a third and that is using packets
but that third option is more difficult then the former 2
probably a long shot but has anyone done the math to perfectly prop an item in an armorstand's hand on top of a player's head?
STILL NOT WORKING BRUH
Oh really?
@marsh hawk not sure about items, but do entities count?
I thought while(true) was a tremendous idea
why?
@grim halo IT WORKED! thanks a lot!
Hmm, idk i want to put a flower on the top of the player's head
just a lot of math to it
whyyyy it dont woork
someone please help me. My server is stuck while saving chunks.
[08:03:42 INFO]: Saving players
[08:03:42 INFO]: Saving worlds
[08:03:42 INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld
[08:03:42 INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved
[08:03:42 INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether
[08:03:42 INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[08:03:42 INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end
[08:03:42 INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[08:03:42 INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved
[08:03:43 INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
I'm using screen in ubuntu, it usually closes it, but now it's just stuck in here. I pregenerated a 20k x 20k area, that can be the issue I quess.
not really any isolation
what is a docker
if you try to run all the servers as the same user sure
but honestly what are you expecting another server to do?
screen was fine for me, it's the first issue since I'm using it. Does my server still saving chunks, or it's just stuck?
might sned him a message about the item on head
its probably saving that 20k x 20k map
I can close the process, but shoud I?
https://github.com/iso2013/PacketEntityAPI
https://github.com/iso2013/MultiLineAPI
@marsh hawk between these two plugins, it spawns entities on top of players heads. MultiLine allows creating multiple lines for player tags, and PacketEntityAPI is pretty much the plugin that does the majority of the work in spawning the entities.
Hm did you try just sending a enter keystroke? Hwo long is it hanging now?
@grim halo why it dont work?
@keen compass Yeah taht's entities though, I need the rotation of an armorstand's arm to perfectly position an item
@frigid ember Because that is not how any of this works. But you neither wanted my recommendation nor my quickfix. So go and use your while(true)
I did the math for this not too long ago
its really not all that hard
just need to use radians
all i have so far is the yaw down
@grim halo i asked for your quickfix
pitch*
well better start sprucing up on your circles 😛
bungee saying that survival is offline
bascially need to use a circle to determine at what point the arm needs to be in relation to the players head for a given item. And well the arm rotates
i also have to account for the length of the armorstand's arm
I asked do you want X or Y
Your answer: Yes
set count to a value below 20
oh, different items cause the numbers to be different for the rotation too @marsh hawk so watch out for that
its 60
if i am using the ChatEvent in Bungeecord, commands doesnt work.
any ideas?
this is going to be a pain lmao
public static int count = 60;
Ok now you are just straight up trolling
Well in PackentityAPI as you notice there is a structures file @marsh hawk had to keep track of all entities sizes
so I understand the pain for that in regards to items
but i need to have it 60 wtf
unfortunately there isn't information in regards to item sizes XD
then change == 20 to > 20
That's really strange though; why would items effect rotation numbers
ah right
does anyone knows a good economy plugin?
Yes that will def spam chat.
Vault
new Thread(() -> {
while(true){
if (getCount() == 20){
SelectWinMap.selectWinMap();
Bukkit.broadcastMessage("§8[§6Vote§8] §7Map §6" + Map + "§7has won! §3(" + MapW + "Votes)");
}
}
}).start();
alright have fun @grim halo 😉 going to rest now lol
public void run() {
if (count == 0) {
RunGame();
}else{
count--;
<- Why not check if count == 20 here and then broadcast?
coutdown = "" + count;
}
gotta crack open the good ol' graphing calculator
Additionally if you use threads, its generally considered to use while(Thread.currentThread().isInterrupted()) instead of while(true)
Considered better practice
!
Isinterrupted
Dont event start
?
He wont comprehend a single word you say.
Scroll up and read the full convo with him.
AbNormal|has
add a space there please
also 1|Votes
its something that will trigger people
I think i've figured out pitch
but now i need to do yaw
o-o
screw you radians & circular functions
and while im at it
yaw is horizontal
maths as a whole
pitch is vertical
yaw = x = cos
if i remember by my top of my head
not really equal
but this is how it's used 🤔
pitch = z = sin
thank god for desmos, this wouldve taken me yonks to do in my head
what's this exactly for? 🤔
im trying to positon an armorstand's arm ontop of the player's head
@marsh hawk
would be easy if i didnt have to account for the armorstand's arm length
hm i could
Would still be the same problem with the length of the arm though
how can i loop through PersistentDataContainer data?
you just need the vector to get the start
then the length is the magnitude you give to that vector ? 🤔
javadocs wouldv have gave you a quick answers on that @stuck quartz
declaration: package: org.bukkit.persistence, interface: PersistentDataContainer
ok, thanks
I am gettomg this error
https://hasteb.in/agukamif.apache
Here is my codeInventory inventory = Bukkit.createInventory(player, InventoryType.ANVIL); player.openInventory(inventory)
repost
i think you need the arm start
then get the vector direction
torwards the target
i'll have to try myself
Is there a way to prevent mobs from attacking certain players?
I don't want this skeleton to attack players on a specific bukkit scoreboard team
How can I get \t to work in player.sendMessage()? It comes up as a weird symbol currently.
@frigid ember I think you need to write your own AI goal selectors
listen to this
declaration: package: org.bukkit.event.entity, class: EntityTargetEvent
@unkempt ridge what are you looking for exactly? Evenly spaced columns?
cancel if its your player
Is there some documentation detailing how to do that or where to start?
oh ok
Thanks Stellrow
I thought about that but it might target the same player over and over again.
@silent veldt yes I have "PlayerName\t\t\tPlayerLevel"
it already check alot of times by default even if it has a target
so its not that important
Minecraft uses a nonproportional font, so tab spacing won't work
You can do it manually, but it's.. difficult
My point is with a custom goal selector you could cycle throught the players nearby and selecto only those in a team.
If you just cancel the event the mob might just stand around while allies are nearby even when there is a potential enemy in sight.
is there any other way besides manually? I can just do 8-12 spaces and I tihnk that should work
thats sad escape characters don't worrk 😭
You can do the spaces manually, sure. But the columns probably won't line up. Depends on what you're displaying in the first column
not sure how it would react
My point is with a custom goal selector you could cycle throught the players nearby and selecto only those in a team.
If you just cancel the event the mob might just stand around while allies are nearby even when there is a potential enemy in sight.
@grim halo Exactly, thats what I think it will do
im mostly aiming towards a list of all in range players
wich the entity just cycles through once cancelled/not available
Right, but how would I know if it no longer has a target?
I think the event will be fired for the closest player
the getTarget will return null
i guess it could be fancy
you might be able to make the player invisible to the entity
@silent veldt how can I do it so all 3 columns line up with their headers?
not sure
You measure the width of each character manually, write a class that will give you the width of a particular display string, calculate the padding you need between columns, then leverage the fact that normal and bold spaces are 4px and 5px individually and you can cover any column spacing over 11px with a combination of the two
Hello, for the server i am staff on there is a weird thing where you can break zombiepigmen spawners but you dont actual pick up the spawners.
That's how I did it, at least.
Thats most likely from silkspawnrs not spigot
meaning you should seek help on theyr page
Lol
would be so much easier if escape charters were a thing ._. I'll do some research
Have you got any ideas tho why it does that
Yup as I said, not easy. But once you get it it looks really nice
@unkempt ridge I think this effect is what you're looking for
@grim halo very late but yes I was talking about a daemon
I got it kinda figured out
Its on the actual pc that's hosting the server
@silent veldt somewhat like that yeah my headers were going to be at the top and the information displayed below them
why did you blur out UUID if its just your indentifier that you can get from the nickname?
yea idk, theres no point in hiding any of that info lol
So I did this, and the Play.geometrycraft.host still leads to the 25565 port
How do I make it to the play.geometrycraft.host go to 25577?
you need to wait for DNS to refresh probably
@sinful spire its been 4 hours
Yes
try giving it like 2 minutes
Change it and give it 2 min?
also whats that A record also with play.domain.host?
?
Same domain
wdym same domain
They both have the same domain
No, namecheap
Yeah
the SRV protocol seems to need "_tpc.play"
Ph
tcp*
_tcp.play right
Oki
@bronze acorn how do i change?
U bought this domain for pretty cheap, like 2 bucks
yeah
I*
just sign up at https://cloudflare.com
cf is free until you start to use theirs premium services
yeah
Oh really? Even for a domain?
yeah
i have a namecheap domain as well but i use cloudflare
their free services are good enough
i dont need a domain so i just got a freenom domain
no
cloudflare is free forever
on cf its unlimited
Oh
just pay for namecheap
yesh
.host is like cheap
How do I use the namecjeap domain with cf? A guide?
so once you register it'll tell you to add a site
just point your DNS to cloudflare
then you type in your domain
and then itll scan to see if its like existing or whatever
it'll take a few minutes ^
then itll tell u to change the domain nameservers to cloudflares
I gtg, thank you guys
and that might take 5 minutes up to an hour or so
cya
I'll look into cloudfare
aight cy
Is it really good?
yeah
yesh
Ok cya
you get free 3 page rules
Thnx again
which is enough for most people
it took cf once 48h to get dns up 😄
like yesterday
Is there away where i can host my vps without puTTY wont close?
what is getEnrity
getEnrity
ENTITY
brandon
as long as ur machine is always on
then u dont have to have putty open
if you have a task running
just ssh later
ah
i'd say dont declare an entity variable if its only gonna be used once
just use event getEntity instanceof but its whatever
true, but im going to use it after the else probably
wow it doesnt error out after a damage
nice that works but it i guess it doesnt work as action_bar
How can I make a string out af an array and remove the first "item" frome the array in the string
Im a java beginner, i nedd the code please
.-.
u need spoonfeed?
final StringBuilder strBldr = new StringBuilder();
final String[] yourArray = ...
for (int i = 1; i < yourArray.length; i++)
strBldr.append(yourArray[i]).append(' ');
Thanks
ew
that generates a string without the first element
be sure that the array is at least 2 elements
or it will yeet itself
don’t forget to append a space
assuming they’re strings
which would make sense
There ya go
wait nvm i can improve
How I can add Javadoc in Visual Studio Code
a question, what does player.getHealth() return? because 0,5hp seems to be 4
Heya, anyone knows how I can get the Player who fired an arrow (in for example ProjectileLaunchEvent)
It’s a double
ohh
Each half heart is 1 hp
final StringBuilder strBldr = new StringBuilder();
final String[] yourArray = ...
for (int i = 1; i < yourArray.length; i++)
strBldr.append(yourArray[i]).append(' ');
@sturdy oar
And how is the ne string calles
what
nevermind there was a sneaky * 2 in my code lol
😐
strBldr.toString
Ok thanks
TheViperShow wanna feed me the answer to my question? ;)
which question
How I can get the Player who fired an arrow (in for example ProjectileLaunchEvent)
Issa projectile
arrayName[1].toString() lmao
Projectile#getShooter
It has a source
shooter is an entity
Get it’s source and then get the shooter
it will return ProjectileShooter, and then check if shooter is instanceof Player
Not always an entity
If the shooter is a player then tada you can cast
yeah it can be a dispenser my bad
Wait are you guys saying that event.getEntity returns the entity causing rhe projectile, and not the actual projectile??
No
read the docs
Event.getEntity.getShooter
No it returns the projectile
Anybody known how to add Javadoc in Visual Studio Code?
you type it out
you mean like attaching the doc?
Yes
@EventHandler
public final void bruh(final ProjectileLaunchEvent bruhEvent) {
final ProjectileSource prjS = bruhEvent.getEntity().getShooter();
if (!(prjS instanceof Player)) return;
final Player player = (Player) prjS;
// do your stuff
}
``` @karmic sable
Thanks TheViper but all I needed was the "getShooter" which I didn't know existed ;) But yeah thanks!
@trim lodge are you using vscode java pack?
smh do people really use VSCode for java
You can get intelIJ for free
Intellj is better?
Or eclipse, or netbeans
intelIJ is what I use, had no issues with it
Ok
Like it does work, i even use it for NodeJS , but i honestly wouldn't recommend it for Java
I'm going to install it, could you help me with the installation?
i mean it's stupidly easy
if you have Windows 10
the setup wizard will do basically everything for you
I would just need help adding the libraries and little else
Isn’t windows 10 not a free update anymore
dont think it is
i mean a license is 5$
I really need a way to register entities in 1.15.2, does anyone have a way to do it?
what do you mean "register entity?"
registering custom NMS entities
and what's the reason for registering entities in to the nms..?
so that I can spawn them
@sturdy oar Help me xD
https://prnt.sc/tk8ym4
From here I need something to be able to develop plugins in java?
There are better ways than injecting your entities in to NMS
disable Plugin Development
you're 99.9% not going to code IntelliJ plugins i think
the rest is fine
xD
so that I can spawn them
@polar gust be more precise
you can already spawn w/e you want without much problem
i sometimes even use the api to avoid using nms
And here??? xD
https://prnt.sc/tk904k
select java 8 where it says 14
top bar
actually nvm thats the first project thing
go with empty project,write ur name
make him install Minecraft Development Plugin
How can i load a world with a plugin
Like put a plugin in a server?
Any code or is it too much
Its actually rather simple to load a world
Yeah
I just want to load it no generation
you can use Multiverse API tbh
they probably allow this kind of stuff
otherwise I'm pretty sure you'll need NMS
Ok so it is not possible with just bukkit/spigot api
Maby getServer().getWorlds.add(worldname;
declaration: package: org.bukkit, class: WorldCreator
'new WorldCreator("worldName").createWorld()'
mh probably
Has been tested
but that just creates the world folder doesn't it
Its a thats it rather than probably
If it exists its gonna load it instead
As its common for almost everything
Thanks
Hello, I would like to know how it would be possible for me to retrieve the drops when I break wheat for example 🙂 ( 1.8.8 )
oh boy
there is an event named something along the lines of blockdropitemevent
but i don't remember if that is exclusive to paper or if it's on spigot as well
yes it's possible
But event.getBlock().getDrops() don't work :c
use a version that isn't over half a decade old 🙃
oh wait it's 1.8.8
jk
oh wait it's 1.8.8
@sturdy oar yup
javadoc for 1.8.8 is almost inexsistent
As far as I know, up until 1.13, the #getDrops method wouldn't take into account the tool (i.e fortune/silk touch) + you'd still need to manually get the drops of any subsequently broken blocks (signs, paintings, sugar cane and so on)
If he wants to take into account enchantments, he'll have to do it manually anyway
cant wait for the moment where md says they no longer accept 1.8 discussions 
gonna buy a cake
noice
And the method does seem to exist in the javadocs you linked to?
And the method does seem to exist in the javadocs you linked to?
@wraith thicket #getDrops ?
Yeah
hey Guys
yep
How do you update armor durability.
HALP PLZ